summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-04-01 00:05:38 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-01 00:05:38 +0000
commit08e67125d8b18ebc16537a67f5857a79294420f7 (patch)
treeecfbb0736423f726052f5df940332091af045735 /service
parentb687f772eacbc984f5ac4a46e19cacaebde84f4e (diff)
parentd44fca25d34d80d98c242423c3a5504a325553ab (diff)
XmlUtil: Restore networks with CURRENT status as ENABLED
am: d44fca25d3 Change-Id: Ibca1e7383d599e1e966a8ee54828759aed26015d
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/util/XmlUtil.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/util/XmlUtil.java b/service/java/com/android/server/wifi/util/XmlUtil.java
index 42303b009..853136b90 100644
--- a/service/java/com/android/server/wifi/util/XmlUtil.java
+++ b/service/java/com/android/server/wifi/util/XmlUtil.java
@@ -59,6 +59,10 @@ import java.util.HashMap;
* </Sub Section 1 Header>
* </Section 1 Header>
* </Document Header>
+ *
+ * Note: These utility methods are meant to be used for:
+ * 1. Backup/restore wifi network data to/from cloud.
+ * 2. Persisting wifi network data to/from disk.
*/
public class XmlUtil {
private static final String TAG = "WifiXmlUtil";
@@ -555,7 +559,13 @@ public class XmlUtil {
configuration.shared = (boolean) value;
break;
case XML_TAG_STATUS:
- configuration.status = (int) value;
+ int status = (int) value;
+ // Any network which was CURRENT before reboot needs
+ // to be restored to ENABLED.
+ if (status == WifiConfiguration.Status.CURRENT) {
+ status = WifiConfiguration.Status.ENABLED;
+ }
+ configuration.status = status;
break;
case XML_TAG_FQDN:
configuration.FQDN = (String) value;