Format plural for numClients
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) { }
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user