Fix ANR caused by temp hotspot

Fixes #126.
This commit is contained in:
Mygod
2019-09-19 11:06:41 +08:00
parent 650b06beae
commit e2aeae9e2f
5 changed files with 39 additions and 26 deletions

View File

@@ -17,6 +17,11 @@ object WifiApManager {
}
}
private val cancelLocalOnlyHotspotRequest by lazy {
WifiManager::class.java.getDeclaredMethod("cancelLocalOnlyHotspotRequest")
}
fun cancelLocalOnlyHotspotRequest() = cancelLocalOnlyHotspotRequest.invoke(app.wifi)
private val setWifiApEnabled by lazy {
WifiManager::class.java.getDeclaredMethod("setWifiApEnabled",
WifiConfiguration::class.java, Boolean::class.java)