summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider/src/com/android/providers/settings
diff options
context:
space:
mode:
authorVinit Deshapnde <vinitd@google.com>2013-09-06 17:12:41 -0700
committerVinit Deshapnde <vinitd@google.com>2013-09-06 17:12:41 -0700
commit1d1319e3e1c266399ca1805ef1453bca71fdf6ce (patch)
tree490050db0c0b14c45e20c110215ee499ad39741c /packages/SettingsProvider/src/com/android/providers/settings
parent2def61485413084e68233c89ba956a2282fbacd1 (diff)
downloadframeworks_base-1d1319e3e1c266399ca1805ef1453bca71fdf6ce.zip
frameworks_base-1d1319e3e1c266399ca1805ef1453bca71fdf6ce.tar.gz
frameworks_base-1d1319e3e1c266399ca1805ef1453bca71fdf6ce.tar.bz2
Don't restore EAP-TLS networks from backup
Since they need certificates that are not backed up/restored; restoring them is not that useful. Bug: 6544151 Change-Id: Ida1a98dc4f01ec1883ce7f76e52f87a27cc814cc
Diffstat (limited to 'packages/SettingsProvider/src/com/android/providers/settings')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
index 3f04470..16d57b9 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
@@ -137,6 +137,7 @@ public class SettingsBackupAgent extends BackupAgentHelper {
static class Network {
String ssid = ""; // equals() and hashCode() need these to be non-null
String key_mgmt = "";
+ boolean certUsed = false;
final ArrayList<String> rawLines = new ArrayList<String>();
public static Network readFromStream(BufferedReader in) {
@@ -167,6 +168,12 @@ public class SettingsBackupAgent extends BackupAgentHelper {
ssid = line;
} else if (line.startsWith("key_mgmt")) {
key_mgmt = line;
+ } else if (line.startsWith("client_cert=")) {
+ certUsed = true;
+ } else if (line.startsWith("ca_cert=")) {
+ certUsed = true;
+ } else if (line.startsWith("ca_path=")) {
+ certUsed = true;
}
}
@@ -246,6 +253,13 @@ public class SettingsBackupAgent extends BackupAgentHelper {
public void write(Writer w) throws IOException {
for (Network net : mNetworks) {
+ if (net.certUsed) {
+ // Networks that use certificates for authentication can't be restored
+ // because the certificates they need don't get restored (because they
+ // are stored in keystore, and can't be restored)
+ continue;
+ }
+
net.write(w);
}
}