summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2015-10-11 18:08:39 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-10-11 18:08:39 +0000
commit0dc1746ef6668427ca96920efcaabdad589f2a97 (patch)
treeab4ad9b9e9ffc364fb50e09c54f463169d57e5ac
parent60c3052f42a0872a86fa3e57849f8e62c41a8db6 (diff)
parent082dd48cb77c4ba0fccaa13906b32f3219184b37 (diff)
downloadandroid_frameworks_opt_net_wifi-0dc1746ef6668427ca96920efcaabdad589f2a97.tar.gz
android_frameworks_opt_net_wifi-0dc1746ef6668427ca96920efcaabdad589f2a97.tar.bz2
android_frameworks_opt_net_wifi-0dc1746ef6668427ca96920efcaabdad589f2a97.zip
am 082dd48c: am 6d88025b: Merge "Don\'t hold on to last scan results if scan is empty" into mnc-dr-dev
* commit '082dd48cb77c4ba0fccaa13906b32f3219184b37': Don't hold on to last scan results if scan is empty
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index abae99886..27c929bfb 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -3829,21 +3829,6 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
}
- /*
- void ageOutScanResults(int age) {
- synchronized(mScanResultCache) {
- // Trim mScanResults, which prevent WifiStateMachine to return
- // obsolete scan results to queriers
- long now = System.CurrentTimeMillis();
- for (int i = 0; i < mScanResults.size(); i++) {
- ScanResult result = mScanResults.get(i);
- if ((result.seen > now || (now - result.seen) > age)) {
- mScanResults.remove(i);
- }
- }
- }
- }*/
-
private static final String IE_STR = "ie=";
private static final String ID_STR = "id=";
private static final String BSSID_STR = "bssid=";
@@ -3855,8 +3840,6 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno
private static final String DELIMITER_STR = "====";
private static final String END_STR = "####";
- int emptyScanResultCount = 0;
-
// Used for matching BSSID strings, at least one characteer must be a non-zero number
private static Pattern mNotZero = Pattern.compile("[1-9a-fA-F]");
@@ -3916,23 +3899,13 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno
if (sid == -1) break;
}
- // Age out scan results, we return all scan results found in the last 12 seconds,
- // and NOT all scan results since last scan.
- // ageOutScanResults(12000);
-
scanResults = scanResultsBuf.toString();
+
if (TextUtils.isEmpty(scanResults)) {
- emptyScanResultCount++;
- if (emptyScanResultCount > 10) {
- // If we got too many empty scan results, the current scan cache is stale,
- // hence clear it.
- mScanResults = new ArrayList<>();
- }
+ mScanResults = new ArrayList<>();
return;
}
- emptyScanResultCount = 0;
-
mWifiConfigStore.trimANQPCache(false);
// note that all these splits and substrings keep references to the original