Merge branch 'master' into s

This commit is contained in:
Mygod
2021-07-10 19:26:22 -04:00
10 changed files with 41 additions and 31 deletions

View File

@@ -389,7 +389,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
}
}
true
} catch (e: IllegalArgumentException) {
} catch (e: RuntimeException) {
SmartSnackbar.make(e).show()
false
}

View File

@@ -326,6 +326,10 @@ object WifiApManager {
private val cancelLocalOnlyHotspotRequest by lazy {
WifiManager::class.java.getDeclaredMethod("cancelLocalOnlyHotspotRequest")
}
/**
* This is the only way to unregister requests besides app exiting.
* Therefore, we are happy with crashing the app if reflection fails.
*/
@RequiresApi(26)
fun cancelLocalOnlyHotspotRequest() = cancelLocalOnlyHotspotRequest(Services.wifi)