Created
May 5, 2020 22:22
-
-
Save MrCrambo/835924bbbc366acd4c63d4db7843f25a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!mWifiScanning && timeNow > mWifiLastTime + WIFI_SLEEP_TIMEOUT) | |
{ | |
if (mWifiBroadcastReceiver != null && !mWifiRegistered) | |
{ | |
mContext.registerReceiver(mWifiBroadcastReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); | |
mWifiRegistered = true; | |
} | |
if (mWifiManager.startScan()) | |
{ | |
mWifiTime = timeNow; | |
try | |
{ | |
mContext.unregisterReceiver(mWifiBroadcastReceiver); | |
mWifiRegistered = false; | |
} catch (Throwable e) { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment