Improve debug info
This commit is contained in:
@@ -144,23 +144,23 @@ object WifiApManager {
|
|||||||
val noArgs = args?.size ?: 0
|
val noArgs = args?.size ?: 0
|
||||||
return when (val name = method.name) {
|
return when (val name = method.name) {
|
||||||
"onStateChanged" -> {
|
"onStateChanged" -> {
|
||||||
if (noArgs != 2) Timber.w("Unexpected args for $name: $args")
|
if (noArgs != 2) Timber.w("Unexpected args for $name: ${args?.contentToString()}")
|
||||||
callback.onStateChanged(args!![0] as Int, args[1] as Int)
|
callback.onStateChanged(args!![0] as Int, args[1] as Int)
|
||||||
}
|
}
|
||||||
"onNumClientsChanged" -> @Suppress("DEPRECATION") {
|
"onNumClientsChanged" -> @Suppress("DEPRECATION") {
|
||||||
if (Build.VERSION.SDK_INT >= 30) Timber.w(Exception("Unexpected onNumClientsChanged"))
|
if (Build.VERSION.SDK_INT >= 30) Timber.w(Exception("Unexpected onNumClientsChanged"))
|
||||||
if (noArgs != 1) Timber.w("Unexpected args for $name: $args")
|
if (noArgs != 1) Timber.w("Unexpected args for $name: ${args?.contentToString()}")
|
||||||
callback.onNumClientsChanged(args!![0] as Int)
|
callback.onNumClientsChanged(args!![0] as Int)
|
||||||
}
|
}
|
||||||
"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"))
|
||||||
if (noArgs != 1) Timber.w("Unexpected args for $name: $args")
|
if (noArgs != 1) Timber.w("Unexpected args for $name: ${args?.contentToString()}")
|
||||||
callback.onConnectedClientsChanged((args!![0] as Iterable<*>)
|
callback.onConnectedClientsChanged((args!![0] as Iterable<*>)
|
||||||
.map { getMacAddress(it) as MacAddress })
|
.map { getMacAddress(it) as MacAddress })
|
||||||
}
|
}
|
||||||
"onInfoChanged" -> @TargetApi(30) {
|
"onInfoChanged" -> @TargetApi(30) {
|
||||||
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onInfoChanged"))
|
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onInfoChanged"))
|
||||||
if (noArgs != 1) Timber.w("Unexpected args for $name: $args")
|
if (noArgs != 1) Timber.w("Unexpected args for $name: ${args?.contentToString()}")
|
||||||
val softApInfo = args!![0]
|
val softApInfo = args!![0]
|
||||||
if (softApInfo != null && classSoftApInfo.isAssignableFrom(softApInfo.javaClass)) {
|
if (softApInfo != null && classSoftApInfo.isAssignableFrom(softApInfo.javaClass)) {
|
||||||
callback.onInfoChanged(getFrequency(softApInfo) as Int, getBandwidth(softApInfo) as Int)
|
callback.onInfoChanged(getFrequency(softApInfo) as Int, getBandwidth(softApInfo) as Int)
|
||||||
@@ -168,7 +168,7 @@ object WifiApManager {
|
|||||||
}
|
}
|
||||||
"onCapabilityChanged" -> @TargetApi(30) {
|
"onCapabilityChanged" -> @TargetApi(30) {
|
||||||
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onCapabilityChanged"))
|
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onCapabilityChanged"))
|
||||||
if (noArgs != 1) Timber.w("Unexpected args for $name: $args")
|
if (noArgs != 1) Timber.w("Unexpected args for $name: ${args?.contentToString()}")
|
||||||
val softApCapability = args!![0]
|
val softApCapability = args!![0]
|
||||||
var supportedFeatures = 0L
|
var supportedFeatures = 0L
|
||||||
var probe = 1L
|
var probe = 1L
|
||||||
@@ -182,7 +182,7 @@ object WifiApManager {
|
|||||||
}
|
}
|
||||||
"onBlockedClientConnecting" -> @TargetApi(30) {
|
"onBlockedClientConnecting" -> @TargetApi(30) {
|
||||||
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onBlockedClientConnecting"))
|
if (Build.VERSION.SDK_INT < 30) Timber.w(Exception("Unexpected onBlockedClientConnecting"))
|
||||||
if (noArgs != 2) Timber.w("Unexpected args for $name: $args")
|
if (noArgs != 2) Timber.w("Unexpected args for $name: ${args?.contentToString()}")
|
||||||
callback.onBlockedClientConnecting(getMacAddress(args!![0]) as MacAddress, args[1] as Int)
|
callback.onBlockedClientConnecting(getMacAddress(args!![0]) as MacAddress, args[1] as Int)
|
||||||
}
|
}
|
||||||
else -> callSuper(interfaceSoftApCallback, proxy, method, args)
|
else -> callSuper(interfaceSoftApCallback, proxy, method, args)
|
||||||
|
|||||||
Reference in New Issue
Block a user