diff options
author | vandwalle <vandwalle@google.com> | 2014-09-23 22:52:48 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-23 22:52:48 +0000 |
commit | 9f1954c8525eadb94f37299c0f810e009e2c6037 (patch) | |
tree | 2ca28c5bdd342d5bb64797fc1f1b5229c620c065 /wifi | |
parent | 7e872cb6a5f8b706e2587d1468803c2be1f04d67 (diff) | |
parent | 8e5677d436c5d1d6f7e3b5d36c13636c12499fb4 (diff) | |
download | frameworks_base-9f1954c8525eadb94f37299c0f810e009e2c6037.zip frameworks_base-9f1954c8525eadb94f37299c0f810e009e2c6037.tar.gz frameworks_base-9f1954c8525eadb94f37299c0f810e009e2c6037.tar.bz2 |
am 2906c72f: am 0829f6b6: Merge "handle bssid blacklist in case of dhcp failures" into lmp-dev
* commit '2906c72fe68573ad71c0802dcb698ce67e4c6497':
handle bssid blacklist in case of dhcp failures
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/ScanResult.java | 9 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 57 |
2 files changed, 61 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java index 27c2541..29656c9 100644 --- a/wifi/java/android/net/wifi/ScanResult.java +++ b/wifi/java/android/net/wifi/ScanResult.java @@ -107,6 +107,12 @@ public class ScanResult implements Parcelable { public int autoJoinStatus; /** + * num IP configuration failures + * @hide + */ + public int numIpConfigFailures; + + /** * @hide * Last time we blacklisted the ScanResult */ @@ -256,6 +262,7 @@ public class ScanResult implements Parcelable { untrusted = source.untrusted; numConnection = source.numConnection; numUsage = source.numUsage; + numIpConfigFailures = source.numIpConfigFailures; } } @@ -320,6 +327,7 @@ public class ScanResult implements Parcelable { dest.writeInt(untrusted ? 1 : 0); dest.writeInt(numConnection); dest.writeInt(numUsage); + dest.writeInt(numIpConfigFailures); if (informationElements != null) { dest.writeInt(informationElements.length); for (int i = 0; i < informationElements.length; i++) { @@ -355,6 +363,7 @@ public class ScanResult implements Parcelable { sr.untrusted = in.readInt() != 0; sr.numConnection = in.readInt(); sr.numUsage = in.readInt(); + sr.numIpConfigFailures = in.readInt(); int n = in.readInt(); if (n != 0) { sr.informationElements = new InformationElement[n]; diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index d27c2f7..4f5f31a 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -203,6 +203,12 @@ public class WifiConfiguration implements Parcelable { public int status; /** + * The configuration needs to be written to networkHistory.txt + * @hide + */ + public boolean dirty; + + /** * The code referring to a reason for disabling the network * Valid when {@link #status} == Status.DISABLED * @hide @@ -621,6 +627,18 @@ public class WifiConfiguration implements Parcelable { /** * @hide + * Number of IP config failures + */ + public int numIpConfigFailures; + + /** + * @hide + * Number of Auth failures + */ + public int numAuthFailures; + + /** + * @hide * Last time we blacklisted the configuration */ public long blackListTimestamp; @@ -884,7 +902,10 @@ public class WifiConfiguration implements Parcelable { } else if (status > autoJoinStatus) { blackListTimestamp = System.currentTimeMillis(); } - autoJoinStatus = status; + if (status != autoJoinStatus) { + autoJoinStatus = status; + dirty = true; + } } @Override @@ -893,7 +914,7 @@ public class WifiConfiguration implements Parcelable { if (this.status == WifiConfiguration.Status.CURRENT) { sbuf.append("* "); } else if (this.status == WifiConfiguration.Status.DISABLED) { - sbuf.append("- DSBLE: ").append(this.disableReason).append(" "); + sbuf.append("- DSBLE"); } sbuf.append("ID: ").append(this.networkId).append(" SSID: ").append(this.SSID). append(" BSSID: ").append(this.BSSID).append(" FQDN: ").append(this.FQDN). @@ -902,8 +923,20 @@ public class WifiConfiguration implements Parcelable { if (this.numConnectionFailures > 0) { sbuf.append(" numConnectFailures ").append(this.numConnectionFailures).append("\n"); } + if (this.numIpConfigFailures > 0) { + sbuf.append(" numIpConfigFailures ").append(this.numIpConfigFailures).append("\n"); + } + if (this.numAuthFailures > 0) { + sbuf.append(" numAuthFailures ").append(this.numAuthFailures).append("\n"); + } if (this.autoJoinStatus > 0) { - sbuf.append(" autoJoinStatus ").append(this.numConnectionFailures).append("\n"); + sbuf.append(" autoJoinStatus ").append(this.autoJoinStatus).append("\n"); + } + if (this.disableReason > 0) { + sbuf.append(" disableReason ").append(this.disableReason).append("\n"); + } + if (this.numAssociation > 0) { + sbuf.append(" numAssociation ").append(this.numAssociation).append("\n"); } if (this.didSelfAdd) sbuf.append(" didSelfAdd"); if (this.selfAdded) sbuf.append(" selfAdded"); @@ -1028,10 +1061,17 @@ public class WifiConfiguration implements Parcelable { } } if (this.scanResultCache != null) { - sbuf.append("scan cache: "); + sbuf.append("Scan Cache: "); for(ScanResult result : this.scanResultCache.values()) { sbuf.append("{").append(result.BSSID).append(",").append(result.frequency); - sbuf.append(",").append(result.level).append(",st="); + sbuf.append(",").append(result.level); + if (result.autoJoinStatus > 0) { + sbuf.append(",st=").append(result.autoJoinStatus); + } + if (result.numIpConfigFailures > 0) { + sbuf.append(",ipfail="); + sbuf.append(result.numIpConfigFailures); + } sbuf.append(result.autoJoinStatus).append("} "); } sbuf.append('\n'); @@ -1356,6 +1396,8 @@ public class WifiConfiguration implements Parcelable { lastDisconnected = source.lastDisconnected; lastConnectionFailure = source.lastConnectionFailure; numConnectionFailures = source.numConnectionFailures; + numIpConfigFailures = source.numIpConfigFailures; + numAuthFailures = source.numAuthFailures; numScorerOverride = source.numScorerOverride; numScorerOverrideAndSwitchedNetwork = source.numScorerOverrideAndSwitchedNetwork; numAssociation = source.numAssociation; @@ -1370,6 +1412,7 @@ public class WifiConfiguration implements Parcelable { autoJoinUseAggressiveJoinAttemptThreshold = source.autoJoinUseAggressiveJoinAttemptThreshold; autoJoinBailedDueToLowRssi = source.autoJoinBailedDueToLowRssi; + dirty = source.dirty; } } @@ -1420,6 +1463,8 @@ public class WifiConfiguration implements Parcelable { dest.writeLong(blackListTimestamp); dest.writeLong(lastConnectionFailure); dest.writeInt(numConnectionFailures); + dest.writeInt(numIpConfigFailures); + dest.writeInt(numAuthFailures); dest.writeInt(numScorerOverride); dest.writeInt(numScorerOverrideAndSwitchedNetwork); dest.writeInt(numAssociation); @@ -1478,6 +1523,8 @@ public class WifiConfiguration implements Parcelable { config.blackListTimestamp = in.readLong(); config.lastConnectionFailure = in.readLong(); config.numConnectionFailures = in.readInt(); + config.numIpConfigFailures = in.readInt(); + config.numAuthFailures = in.readInt(); config.numScorerOverride = in.readInt(); config.numScorerOverrideAndSwitchedNetwork = in.readInt(); config.numAssociation = in.readInt(); |