diff options
author | vandwalle <vandwalle@google.com> | 2015-01-29 05:00:44 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-01-29 05:00:44 +0000 |
commit | 7e553a06a0506529563c6a0920e0de2a0d48cedc (patch) | |
tree | 65545d30113dc5e9d99ebe5eea615ac1ecd96443 | |
parent | cf8ae79ef28b8e25ab67638ee1c86abe6bf06c6b (diff) | |
parent | 0a22d43c9143475c889ce54f0de6261e8857ab9d (diff) | |
download | frameworks_base-7e553a06a0506529563c6a0920e0de2a0d48cedc.zip frameworks_base-7e553a06a0506529563c6a0920e0de2a0d48cedc.tar.gz frameworks_base-7e553a06a0506529563c6a0920e0de2a0d48cedc.tar.bz2 |
Merge "aggressively blacklist WifiConfiguration for the purpose of switching network" into lmp-mr1-dev automerge: d169839
automerge: 0a22d43
* commit '0a22d43c9143475c889ce54f0de6261e8857ab9d':
aggressively blacklist WifiConfiguration for the purpose of switching network
-rwxr-xr-x | core/res/res/values/config.xml | 4 | ||||
-rwxr-xr-x | core/res/res/values/symbols.xml | 1 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 46 |
3 files changed, 51 insertions, 0 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 3843d16..f2d9de8 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -424,6 +424,10 @@ <!-- Integer indicating wpa_supplicant scan interval in milliseconds --> <integer translatable="false" name="config_wifi_supplicant_scan_interval">15000</integer> + <!-- Integer indicating amount of time failed networks areblacklisted for the purpose + of network switching in milliseconds --> + <integer translatable="false" name="config_wifi_network_switching_blacklist_time">172800000</integer> + <!-- Integer indicating wpa_supplicant scan interval when p2p is connected in milliseconds --> <integer translatable="false" name="config_wifi_scan_interval_p2p_connected">60000</integer> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index e47d5f7..1055547 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -327,6 +327,7 @@ <java-symbol type="integer" name="config_wifi_framework_scan_result_rssi_level_patchup_value" /> <java-symbol type="integer" name="config_wifi_framework_current_network_boost" /> <java-symbol type="string" name="config_wifi_random_mac_oui" /> + <java-symbol type="integer" name="config_wifi_network_switching_blacklist_time" /> <java-symbol type="bool" name="editable_voicemailnumber" /> diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 6543c03..87db951 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -688,6 +688,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; @@ -1148,6 +1173,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()) { @@ -1518,6 +1555,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; @@ -1587,6 +1627,9 @@ public class WifiConfiguration implements Parcelable { dest.writeInt(lastUpdateUid); dest.writeLong(blackListTimestamp); dest.writeLong(lastConnectionFailure); + dest.writeLong(lastRoamingFailure); + dest.writeInt(lastRoamingFailureReason); + dest.writeLong(roamingFailureBlackListTimeMilli); dest.writeInt(numConnectionFailures); dest.writeInt(numIpConfigFailures); dest.writeInt(numAuthFailures); @@ -1649,6 +1692,9 @@ public class WifiConfiguration implements Parcelable { config.lastUpdateUid = in.readInt(); 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(); |