Update dependencies

This commit is contained in:
Mygod
2018-06-23 18:59:31 +08:00
parent b49ea8635b
commit 2488a528a3
6 changed files with 22 additions and 19 deletions

View File

@@ -105,16 +105,16 @@ object WifiP2pManagerHelper {
fun WifiP2pManager.requestPersistentGroupInfo(c: WifiP2pManager.Channel,
listener: (Collection<WifiP2pGroup>) -> Unit) {
val proxy = Proxy.newProxyInstance(interfacePersistentGroupInfoListener.classLoader,
arrayOf(interfacePersistentGroupInfoListener), { proxy, method, args ->
if (method.name == "onPersistentGroupInfoAvailable") {
if (args.size != 1) Crashlytics.log(Log.WARN, TAG, "Unexpected args: $args")
listener(getGroupList.invoke(args[0]) as Collection<WifiP2pGroup>)
null
} else {
Crashlytics.log(Log.WARN, TAG, "Unexpected method, calling super: $method")
ProxyBuilder.callSuper(proxy, method, args)
}
})
arrayOf(interfacePersistentGroupInfoListener)) { proxy, method, args ->
if (method.name == "onPersistentGroupInfoAvailable") {
if (args.size != 1) Crashlytics.log(Log.WARN, TAG, "Unexpected args: $args")
listener(getGroupList.invoke(args[0]) as Collection<WifiP2pGroup>)
null
} else {
Crashlytics.log(Log.WARN, TAG, "Unexpected method, calling super: $method")
ProxyBuilder.callSuper(proxy, method, args)
}
}
requestPersistentGroupInfo.invoke(this, c, proxy)
}