Merge "Fix wifi crash" into mnc-dev
This commit is contained in:
@@ -176,10 +176,7 @@ public class WifiTracker {
|
||||
mScanner = new Scanner();
|
||||
}
|
||||
|
||||
mScanResultCache.clear();
|
||||
mSeenBssids.clear();
|
||||
mScanId = 0;
|
||||
|
||||
mWorkHandler.sendEmptyMessage(WorkHandler.MSG_RESUME);
|
||||
if (mWifiManager.isWifiEnabled()) {
|
||||
mScanner.resume();
|
||||
}
|
||||
@@ -251,6 +248,12 @@ public class WifiTracker {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleResume() {
|
||||
mScanResultCache.clear();
|
||||
mSeenBssids.clear();
|
||||
mScanId = 0;
|
||||
}
|
||||
|
||||
private Collection<ScanResult> fetchScanResults() {
|
||||
mScanId++;
|
||||
final List<ScanResult> newResults = mWifiManager.getScanResults();
|
||||
@@ -544,6 +547,7 @@ public class WifiTracker {
|
||||
private final class WorkHandler extends Handler {
|
||||
private static final int MSG_UPDATE_ACCESS_POINTS = 0;
|
||||
private static final int MSG_UPDATE_NETWORK_INFO = 1;
|
||||
private static final int MSG_RESUME = 2;
|
||||
|
||||
public WorkHandler(Looper looper) {
|
||||
super(looper);
|
||||
@@ -558,6 +562,9 @@ public class WifiTracker {
|
||||
case MSG_UPDATE_NETWORK_INFO:
|
||||
updateNetworkInfo((NetworkInfo) msg.obj);
|
||||
break;
|
||||
case MSG_RESUME:
|
||||
handleResume();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user