diff options
author | Rebecca Silberstein <silberst@google.com> | 2016-03-25 17:51:00 -0700 |
---|---|---|
committer | Rebecca Silberstein <silberst@google.com> | 2016-03-28 10:56:06 -0700 |
commit | 11b4c4c3c813237826117270741c63faa0d312aa (patch) | |
tree | 16496b301c2a22ebfecda57ce0da21a9a261fc51 | |
parent | ef7053e8dc65c0a9d4f98a6e40f5061a9be3c139 (diff) |
Extend NetworkHistory to incorporate hasEverConnected
Add boolean to NetworkHistory (tracked in
WifiConfiguration.NetworkSelectionStatus) to track if we have ever
connected to the given network with the current configuration.
BUG: 27856504
Change-Id: I5f858afe3128fbc7293b15f8b95892da7cae171e
-rw-r--r-- | service/java/com/android/server/wifi/WifiNetworkHistory.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkHistory.java b/service/java/com/android/server/wifi/WifiNetworkHistory.java index f5ccbb0ba..039319618 100644 --- a/service/java/com/android/server/wifi/WifiNetworkHistory.java +++ b/service/java/com/android/server/wifi/WifiNetworkHistory.java @@ -101,6 +101,7 @@ public class WifiNetworkHistory { private static final String NETWORK_SELECTION_STATUS_KEY = "NETWORK_SELECTION_STATUS"; private static final String NETWORK_SELECTION_DISABLE_REASON_KEY = "NETWORK_SELECTION_DISABLE_REASON"; + private static final String HAS_EVER_CONNECTED_KEY = "HAS_EVER_CONNECTED"; private static final String SEPARATOR = ": "; private static final String NL = "\n"; @@ -167,7 +168,8 @@ public class WifiNetworkHistory { + " choice:" + status.getConnectChoice() + " link:" + numlink + " status:" + config.status - + " nid:" + config.networkId); + + " nid:" + config.networkId + + " hasEverConnected: " + status.getHasEverConnected()); } if (!isValid(config)) { @@ -289,6 +291,8 @@ public class WifiNetworkHistory { if (config.lastFailure != null) { out.writeUTF(FAILURE_KEY + SEPARATOR + config.lastFailure + NL); } + out.writeUTF(HAS_EVER_CONNECTED_KEY + SEPARATOR + + Boolean.toString(status.getHasEverConnected()) + NL); out.writeUTF(NL); // Add extra blank lines for clarity out.writeUTF(NL); @@ -532,6 +536,9 @@ public class WifiNetworkHistory { case SHARED_KEY: config.shared = Boolean.parseBoolean(value); break; + case HAS_EVER_CONNECTED_KEY: + networkStatus.setHasEverConnected(Boolean.parseBoolean(value)); + break; } } } |