diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt index f9d52876..02e70d0f 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt @@ -201,9 +201,10 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(), @TargetApi(30) private fun formatCapability(locale: Locale) = capability?.let { val capability = SoftApCapability(it) + val numClients = numClients val maxClients = capability.maxSupportedClients val supportedFeatures = capability.supportedFeatures - app.resources.getQuantityText(R.plurals.tethering_manage_wifi_capabilities, maxClients).format(locale, + app.resources.getQuantityText(R.plurals.tethering_manage_wifi_capabilities, numClients ?: 0).format(locale, numClients ?: "?", maxClients, sequence { var features = supportedFeatures if (features != 0L) while (features != 0L) { diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt index 892651d1..60e2d157 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt @@ -76,9 +76,10 @@ object WifiApManager { /** * Called when number of connected clients to soft AP changes. * + * It is not recommended to use this legacy method on API 30+. + * * @param numClients number of connected clients */ - @Deprecated("onConnectedClientsChanged") fun onNumClientsChanged(numClients: Int) { } /** diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/root/WifiApCommands.kt b/mobile/src/main/java/be/mygod/vpnhotspot/root/WifiApCommands.kt index a8be8569..b51a9eb6 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/root/WifiApCommands.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/root/WifiApCommands.kt @@ -68,7 +68,6 @@ object WifiApCommands { override fun onStateChanged(state: Int, failureReason: Int) = push(SoftApCallbackParcel.OnStateChanged(state, failureReason)) - @Suppress("OverridingDeprecatedMember") override fun onNumClientsChanged(numClients: Int) = push(SoftApCallbackParcel.OnNumClientsChanged(numClients)) @RequiresApi(30)