Ignore the new onConnectedClientsChanged for now

This commit is contained in:
Mygod
2021-05-28 22:25:03 -04:00
parent bb7efb6897
commit 9d5d7052d3

View File

@@ -95,7 +95,7 @@ object WifiApManager {
/** /**
* Called when information of softap changes. * Called when information of softap changes.
* *
* @param info is the softap information. {@link SoftApInfo} * @param info is the softap information. [SoftApInfo]
* At most one will be returned on API 30. * At most one will be returned on API 30.
*/ */
@RequiresApi(30) @RequiresApi(30)
@@ -104,7 +104,7 @@ object WifiApManager {
/** /**
* Called when capability of softap changes. * Called when capability of softap changes.
* *
* @param capability is the softap capability. {@link SoftApCapability} * @param capability is the softap capability. [SoftApCapability]
*/ */
@RequiresApi(30) @RequiresApi(30)
fun onCapabilityChanged(capability: Parcelable) { } fun onCapabilityChanged(capability: Parcelable) { }
@@ -118,7 +118,7 @@ object WifiApManager {
* {@link SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS}. * {@link SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS}.
* *
* @param client the currently blocked client. * @param client the currently blocked client.
* @param blockedReason one of blocked reason from {@link SapClientBlockedReason} * @param blockedReason one of blocked reason from [SapClientBlockedReason]
*/ */
@RequiresApi(30) @RequiresApi(30)
fun onBlockedClientConnecting(client: Parcelable, blockedReason: Int) { } fun onBlockedClientConnecting(client: Parcelable, blockedReason: Int) { }
@@ -165,18 +165,14 @@ object WifiApManager {
"onConnectedClientsChanged" -> @TargetApi(30) { "onConnectedClientsChanged" -> @TargetApi(30) {
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onConnectedClientsChanged")) if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onConnectedClientsChanged"))
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
callback.onConnectedClientsChanged(when (noArgs) { when (noArgs) {
1 -> args!![0] as List<Parcelable> 1 -> callback.onConnectedClientsChanged(args!![0] as List<Parcelable>)
2 -> { 2 -> null // we use the old method which returns all clients in one call
Timber.w(Exception("Unexpected onConnectedClientsChanged API 31+"))
// dispatchInfoChanged(args!![0])
args!![1] as List<Parcelable>
}
else -> { else -> {
Timber.w("Unexpected args for $name: ${args?.contentToString()}") Timber.w("Unexpected args for $name: ${args?.contentToString()}")
return null null
} }
}) }
} }
"onInfoChanged" -> @TargetApi(30) { "onInfoChanged" -> @TargetApi(30) {
if (noArgs != 1) Timber.w("Unexpected args for $name: ${args?.contentToString()}") if (noArgs != 1) Timber.w("Unexpected args for $name: ${args?.contentToString()}")