From 8e33ab77d7306b44b1e97c2a91f2d67047b0d9fe Mon Sep 17 00:00:00 2001 From: Mygod Date: Mon, 31 May 2021 23:35:24 +0800 Subject: [PATCH] Fix this overriding --- .../mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt index b6316fb6..1f92e1bb 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt @@ -280,13 +280,13 @@ data class SoftApConfigurationCompat( preSharedKey, hiddenSSID, // https://cs.android.com/android/platform/superproject/+/master:frameworks/base/wifi/java/android/net/wifi/SoftApConfToXmlMigrationUtil.java;l=87;drc=aa6527cf41671d1ed417b8ebdb6b3aa614f62344 - SparseIntArray(1).apply { - if (Build.VERSION.SDK_INT >= 23) append(when (val band = apBand.getInt(this)) { + SparseIntArray(1).also { + if (Build.VERSION.SDK_INT >= 23) it.append(when (val band = apBand.getInt(this)) { 0 -> BAND_2GHZ 1 -> BAND_5GHZ -1 -> BAND_LEGACY else -> throw IllegalArgumentException("Unexpected band $band") - }, apChannel.getInt(this)) else append(BAND_LEGACY, 0) + }, apChannel.getInt(this)) else it.append(BAND_LEGACY, 0) }, allowedKeyManagement.nextSetBit(0).let { selected -> require(allowedKeyManagement.nextSetBit(selected + 1) < 0) {