diff options
author | vandwalle <vandwalle@google.com> | 2015-01-29 05:04:48 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-01-29 05:04:48 +0000 |
commit | b53d1a2794e59d5b02d5578528f76691fe723087 (patch) | |
tree | 0efa9322aa87682eee23ae0eb963d6341368e5e7 /wifi/java | |
parent | b6f10982acbf1bc438ca3c24f691573f7a0bc617 (diff) | |
parent | 7e553a06a0506529563c6a0920e0de2a0d48cedc (diff) | |
download | frameworks_base-b53d1a2794e59d5b02d5578528f76691fe723087.zip frameworks_base-b53d1a2794e59d5b02d5578528f76691fe723087.tar.gz frameworks_base-b53d1a2794e59d5b02d5578528f76691fe723087.tar.bz2 |
Merge "aggressively blacklist WifiConfiguration for the purpose of switching network" into lmp-mr1-dev automerge: d169839 automerge: 0a22d43
automerge: 7e553a0
* commit '7e553a06a0506529563c6a0920e0de2a0d48cedc':
aggressively blacklist WifiConfiguration for the purpose of switching network
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 5202cc3..52f2372 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -733,6 +733,31 @@ public class WifiConfiguration implements Parcelable { /** * @hide + * Last time the system tried to roam and failed because of authentication failure or DHCP + * RENEW failure. + */ + public long lastRoamingFailure; + + /** @hide */ + public static int ROAMING_FAILURE_IP_CONFIG = 1; + /** @hide */ + public static int ROAMING_FAILURE_AUTH_FAILURE = 2; + + /** + * @hide + * Initial amount of time this Wifi configuration gets blacklisted for network switching + * because of roaming failure + */ + public long roamingFailureBlackListTimeMilli = 1000; + + /** + * @hide + * Last roaming failure reason code + */ + public int lastRoamingFailureReason; + + /** + * @hide * Last time the system was disconnected to this configuration. */ public long lastDisconnected; @@ -1209,6 +1234,18 @@ public class WifiConfiguration implements Parcelable { sbuf.append( "sec"); } } + if (this.lastRoamingFailure != 0) { + sbuf.append('\n'); + long diff = now_ms - this.lastRoamingFailure; + if (diff <= 0) { + sbuf.append("lastRoamingFailure since <incorrect>"); + } else { + sbuf.append("lastRoamingFailure: ").append(Long.toString(diff/1000)); + sbuf.append( "sec"); + } + } + sbuf.append("roamingFailureBlackListTimeMilli: "). + append(Long.toString(this.roamingFailureBlackListTimeMilli)); sbuf.append('\n'); if (this.linkedConfigurations != null) { for(String key : this.linkedConfigurations.keySet()) { @@ -1595,6 +1632,9 @@ public class WifiConfiguration implements Parcelable { lastConnected = source.lastConnected; lastDisconnected = source.lastDisconnected; lastConnectionFailure = source.lastConnectionFailure; + lastRoamingFailure = source.lastRoamingFailure; + lastRoamingFailureReason = source.lastRoamingFailureReason; + roamingFailureBlackListTimeMilli = source.roamingFailureBlackListTimeMilli; numConnectionFailures = source.numConnectionFailures; numIpConfigFailures = source.numIpConfigFailures; numAuthFailures = source.numAuthFailures; @@ -1667,6 +1707,9 @@ public class WifiConfiguration implements Parcelable { dest.writeString(lastUpdateName); dest.writeLong(blackListTimestamp); dest.writeLong(lastConnectionFailure); + dest.writeLong(lastRoamingFailure); + dest.writeInt(lastRoamingFailureReason); + dest.writeLong(roamingFailureBlackListTimeMilli); dest.writeInt(numConnectionFailures); dest.writeInt(numIpConfigFailures); dest.writeInt(numAuthFailures); @@ -1732,6 +1775,9 @@ public class WifiConfiguration implements Parcelable { config.lastUpdateName = in.readString(); config.blackListTimestamp = in.readLong(); config.lastConnectionFailure = in.readLong(); + config.lastRoamingFailure = in.readLong(); + config.lastRoamingFailureReason = in.readInt(); + config.roamingFailureBlackListTimeMilli = in.readLong(); config.numConnectionFailures = in.readInt(); config.numIpConfigFailures = in.readInt(); config.numAuthFailures = in.readInt(); |