summaryrefslogtreecommitdiffstats
path: root/wifi/java
diff options
context:
space:
mode:
authorPrerepa Viswanadham <dham@google.com>2015-04-10 15:54:48 -0700
committerPrerepa Viswanadham <dham@google.com>2015-04-10 15:54:48 -0700
commit220951a6d0a408313256d0a9078c8ae8d8321c03 (patch)
treea04000f54e94277d455dcc234a50952f01e157a8 /wifi/java
parentf79d5b84d5e591f1675c101a8fea0e6461de5327 (diff)
parentb2ff4151bba45e15b82dca380b1c46175e5d0ec3 (diff)
downloadframeworks_base-220951a6d0a408313256d0a9078c8ae8d8321c03.zip
frameworks_base-220951a6d0a408313256d0a9078c8ae8d8321c03.tar.gz
frameworks_base-220951a6d0a408313256d0a9078c8ae8d8321c03.tar.bz2
Merge commit 'b2ff415' into merge_work
Change-Id: I4f9c662112fc49e4f94315d3c69860607be3bc1e
Diffstat (limited to 'wifi/java')
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java185
-rw-r--r--wifi/java/android/net/wifi/WifiEnterpriseConfig.java2
2 files changed, 3 insertions, 184 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 11bdebb..9cb6f2e 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -424,13 +424,6 @@ public class WifiConfiguration implements Parcelable {
*/
public int userApproved = USER_UNSPECIFIED;
- /**
- * @hide
- * BSSID list on which this configuration was seen.
- * TODO: prevent this list to grow infinitely, age-out the results
- */
- public HashMap<String, ScanResult> scanResultCache;
-
/** The Below RSSI thresholds are used to configure AutoJoin
* - GOOD/LOW/BAD thresholds are used so as to calculate link score
* - UNWANTED_SOFT are used by the blacklisting logic so as to handle
@@ -520,7 +513,7 @@ public class WifiConfiguration implements Parcelable {
* A summary of the RSSI and Band status for that configuration
* This is used as a temporary value by the auto-join controller
*/
- public final class Visibility {
+ public static final class Visibility {
public int rssi5; // strongest 5GHz RSSI
public int rssi24; // strongest 2.4GHz RSSI
public int num5; // number of BSSIDs on 5GHz
@@ -596,47 +589,8 @@ public class WifiConfiguration implements Parcelable {
* age in milliseconds: we will consider only ScanResults that are more recent,
* i.e. younger.
***/
- public Visibility setVisibility(long age) {
- if (scanResultCache == null) {
- visibility = null;
- return null;
- }
-
- Visibility status = new Visibility();
-
- long now_ms = System.currentTimeMillis();
- for(ScanResult result : scanResultCache.values()) {
- if (result.seen == 0)
- continue;
-
- if (result.is5GHz()) {
- //strictly speaking: [4915, 5825]
- //number of known BSSID on 5GHz band
- status.num5 = status.num5 + 1;
- } else if (result.is24GHz()) {
- //strictly speaking: [2412, 2482]
- //number of known BSSID on 2.4Ghz band
- status.num24 = status.num24 + 1;
- }
-
- if ((now_ms - result.seen) > age) continue;
-
- if (result.is5GHz()) {
- if (result.level > status.rssi5) {
- status.rssi5 = result.level;
- status.age5 = result.seen;
- status.BSSID5 = result.BSSID;
- }
- } else if (result.is24GHz()) {
- if (result.level > status.rssi24) {
- status.rssi24 = result.level;
- status.age24 = result.seen;
- status.BSSID24 = result.BSSID;
- }
- }
- }
+ public void setVisibility(Visibility status) {
visibility = status;
- return status;
}
/** @hide */
@@ -1026,31 +980,6 @@ public class WifiConfiguration implements Parcelable {
allowedKeyManagement.get(KeyMgmt.IEEE8021X);
}
- /**
- * most recent time we have seen this configuration
- * @return most recent scanResult
- * @hide
- */
- public ScanResult lastSeen() {
- ScanResult mostRecent = null;
-
- if (scanResultCache == null) {
- return null;
- }
-
- for (ScanResult result : scanResultCache.values()) {
- if (mostRecent == null) {
- if (result.seen != 0)
- mostRecent = result;
- } else {
- if (result.seen > mostRecent.seen) {
- mostRecent = result;
- }
- }
- }
- return mostRecent;
- }
-
/** @hide **/
public void setAutoJoinStatus(int status) {
if (status < 0) status = 0;
@@ -1065,75 +994,6 @@ public class WifiConfiguration implements Parcelable {
}
}
- /** @hide
- * trim the scan Result Cache
- * @param: number of entries to keep in the cache
- */
- public void trimScanResultsCache(int num) {
- if (this.scanResultCache == null) {
- return;
- }
- int currenSize = this.scanResultCache.size();
- if (currenSize <= num) {
- return; // Nothing to trim
- }
- ArrayList<ScanResult> list = new ArrayList<ScanResult>(this.scanResultCache.values());
- if (list.size() != 0) {
- // Sort by descending timestamp
- Collections.sort(list, new Comparator() {
- public int compare(Object o1, Object o2) {
- ScanResult a = (ScanResult)o1;
- ScanResult b = (ScanResult)o2;
- if (a.seen > b.seen) {
- return 1;
- }
- if (a.seen < b.seen) {
- return -1;
- }
- return a.BSSID.compareTo(b.BSSID);
- }
- });
- }
- for (int i = 0; i < currenSize - num ; i++) {
- // Remove oldest results from scan cache
- ScanResult result = list.get(i);
- this.scanResultCache.remove(result.BSSID);
- }
- }
-
- /* @hide */
- private ArrayList<ScanResult> sortScanResults() {
- ArrayList<ScanResult> list = new ArrayList<ScanResult>(this.scanResultCache.values());
- if (list.size() != 0) {
- Collections.sort(list, new Comparator() {
- public int compare(Object o1, Object o2) {
- ScanResult a = (ScanResult)o1;
- ScanResult b = (ScanResult)o2;
- if (a.numIpConfigFailures > b.numIpConfigFailures) {
- return 1;
- }
- if (a.numIpConfigFailures < b.numIpConfigFailures) {
- return -1;
- }
- if (a.seen > b.seen) {
- return -1;
- }
- if (a.seen < b.seen) {
- return 1;
- }
- if (a.level > b.level) {
- return -1;
- }
- if (a.level < b.level) {
- return 1;
- }
- return a.BSSID.compareTo(b.BSSID);
- }
- });
- }
- return list;
- }
-
@Override
public String toString() {
StringBuilder sbuf = new StringBuilder();
@@ -1309,42 +1169,6 @@ public class WifiConfiguration implements Parcelable {
}
}
}
- if (this.scanResultCache != null) {
- sbuf.append("Scan Cache: ").append('\n');
- ArrayList<ScanResult> list = sortScanResults();
- if (list.size() > 0) {
- for (ScanResult result : list) {
- long milli = now_ms - result.seen;
- long ageSec = 0;
- long ageMin = 0;
- long ageHour = 0;
- long ageMilli = 0;
- long ageDay = 0;
- if (now_ms > result.seen && result.seen > 0) {
- ageMilli = milli % 1000;
- ageSec = (milli / 1000) % 60;
- ageMin = (milli / (60*1000)) % 60;
- ageHour = (milli / (60*60*1000)) % 24;
- ageDay = (milli / (24*60*60*1000));
- }
- sbuf.append("{").append(result.BSSID).append(",").append(result.frequency);
- sbuf.append(",").append(String.format("%3d", result.level));
- if (result.autoJoinStatus > 0) {
- sbuf.append(",st=").append(result.autoJoinStatus);
- }
- if (ageSec > 0 || ageMilli > 0) {
- sbuf.append(String.format(",%4d.%02d.%02d.%02d.%03dms", ageDay,
- ageHour, ageMin, ageSec, ageMilli));
- }
- if (result.numIpConfigFailures > 0) {
- sbuf.append(",ipfail=");
- sbuf.append(result.numIpConfigFailures);
- }
- sbuf.append("} ");
- }
- sbuf.append('\n');
- }
- }
sbuf.append("triggeredLow: ").append(this.numUserTriggeredWifiDisableLowRSSI);
sbuf.append(" triggeredBad: ").append(this.numUserTriggeredWifiDisableBadRSSI);
sbuf.append(" triggeredNotHigh: ").append(this.numUserTriggeredWifiDisableNotHighRSSI);
@@ -1652,11 +1476,6 @@ public class WifiConfiguration implements Parcelable {
mIpConfiguration = new IpConfiguration(source.mIpConfiguration);
- if ((source.scanResultCache != null) && (source.scanResultCache.size() > 0)) {
- scanResultCache = new HashMap<String, ScanResult>();
- scanResultCache.putAll(source.scanResultCache);
- }
-
if ((source.connectChoices != null) && (source.connectChoices.size() > 0)) {
connectChoices = new HashMap<String, Integer>();
connectChoices.putAll(source.connectChoices);
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
index 440ad61..6917971 100644
--- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
+++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
@@ -601,7 +601,7 @@ public class WifiEnterpriseConfig implements Parcelable {
}
/**
- * Set plmn for passpoint credential
+ * Get plmn for passpoint credential
* @return the plmn
*/
public String getPlmn() {