Support basic clients count on Android 9-10
This commit is contained in:
@@ -168,7 +168,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
|
||||
}
|
||||
override fun onNumClientsChanged(numClients: Int) {
|
||||
this.numClients = numClients
|
||||
if (Build.VERSION.SDK_INT >= 30) data.notifyChange() // only emits when onCapabilityChanged can be called
|
||||
data.notifyChange()
|
||||
}
|
||||
override fun onInfoChanged(info: List<Parcelable>) {
|
||||
this.info = info
|
||||
@@ -213,6 +213,9 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
|
||||
features = features and bit.inv()
|
||||
} else yield(parent.getText(R.string.tethering_manage_wifi_no_features))
|
||||
}.joinToSpanned())
|
||||
} ?: numClients?.let { numClients ->
|
||||
app.resources.getQuantityText(R.plurals.tethering_manage_wifi_clients, numClients).format(locale,
|
||||
numClients)
|
||||
}
|
||||
override val text get() = parent.resources.configuration.locale.let { locale ->
|
||||
listOfNotNull(failureReason?.let { WifiApManager.failureReasonLookup(it) }, baseError, info.run {
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
<plurals name="tethering_manage_wifi_capabilities">
|
||||
<item quantity="other">已连接 %1$s/%2$d 个设备\n支持功能:%3$s</item>
|
||||
</plurals>
|
||||
<plurals name="tethering_manage_wifi_clients">
|
||||
<item quantity="other">已连接 %d 个设备</item>
|
||||
</plurals>
|
||||
<string name="tethering_manage_wifi_no_features">无</string>
|
||||
<string name="tethering_manage_wifi_client_blocked">已屏蔽 %1$s:%2$s</string>
|
||||
<string name="tethering_manage_wifi_copy_mac">复制 MAC</string>
|
||||
|
||||
@@ -71,6 +71,9 @@
|
||||
<plurals name="tethering_manage_wifi_capabilities">
|
||||
<item quantity="other">已連接 %1$s/%2$d 個設備\n支持功能:%3$s</item>
|
||||
</plurals>
|
||||
<plurals name="tethering_manage_wifi_clients">
|
||||
<item quantity="other">已連接 %d 個設備</item>
|
||||
</plurals>
|
||||
<string name="tethering_manage_wifi_no_features">無</string>
|
||||
<string name="tethering_manage_wifi_client_blocked">已隱藏 %1$s:%2$s</string>
|
||||
<string name="tethering_manage_wifi_copy_mac">複製 MAC</string>
|
||||
|
||||
@@ -78,6 +78,10 @@
|
||||
<item quantity="one">%1$s/%2$d client connected\nSupported features: %3$s</item>
|
||||
<item quantity="other">%1$s/%2$d clients connected\nSupported features: %3$s</item>
|
||||
</plurals>
|
||||
<plurals name="tethering_manage_wifi_clients">
|
||||
<item quantity="one">%d client connected</item>
|
||||
<item quantity="other">%1d clients connected</item>
|
||||
</plurals>
|
||||
<string name="tethering_manage_wifi_no_features">None</string>
|
||||
<string name="tethering_manage_wifi_client_blocked">Blocked %1$s: %2$s</string>
|
||||
<string name="tethering_manage_wifi_copy_mac">Copy MAC</string>
|
||||
|
||||
Reference in New Issue
Block a user