From eddb74df21354dbaaf6d369ab14f70dcd54ac4b7 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 29 May 2021 18:42:56 -0400 Subject: [PATCH] Fix wrong order of SACC constructor --- .../mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 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 a8f9a2d1..fdb3ec8d 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 @@ -26,9 +26,9 @@ data class SoftApConfigurationCompat( var isHiddenSsid: Boolean = false, @TargetApi(23) var channels: SparseIntArray = SparseIntArray(1).apply { put(BAND_2GHZ, 0) }, + var securityType: Int = SoftApConfiguration.SECURITY_TYPE_OPEN, @TargetApi(30) var maxNumberOfClients: Int = 0, - var securityType: Int = SoftApConfiguration.SECURITY_TYPE_OPEN, @TargetApi(28) var isAutoShutdownEnabled: Boolean = true, @TargetApi(28) @@ -237,7 +237,6 @@ data class SoftApConfigurationCompat( else -> throw IllegalArgumentException("Unexpected band $band") }, apChannel.getInt(this)) }, - 0, allowedKeyManagement.nextSetBit(0).let { selected -> require(allowedKeyManagement.nextSetBit(selected + 1) < 0) { "More than 1 key managements supplied: $allowedKeyManagement" @@ -258,7 +257,7 @@ data class SoftApConfigurationCompat( } } }, - if (Build.VERSION.SDK_INT >= 28) TetherTimeoutMonitor.enabled else false, + isAutoShutdownEnabled = if (Build.VERSION.SDK_INT >= 28) TetherTimeoutMonitor.enabled else false, underlying = this) @RequiresApi(30) @@ -271,8 +270,8 @@ data class SoftApConfigurationCompat( if (BuildCompat.isAtLeastS()) getChannels(this) as SparseIntArray else SparseIntArray(1).apply { put(getBand(this) as Int, getChannel(this) as Int) }, - getMaxNumberOfClients(this) as Int, securityType, + getMaxNumberOfClients(this) as Int, isAutoShutdownEnabled(this) as Boolean, getShutdownTimeoutMillis(this) as Long, isClientControlByUserEnabled(this) as Boolean,