summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider
diff options
context:
space:
mode:
authorVinit Deshapnde <vinitd@google.com>2013-09-12 10:59:42 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-12 10:59:42 -0700
commitb20642b999bc7a73c8c69cc6a11984148ffaa383 (patch)
treeb0cc6942be0e2c9d973aba94537af5b4c23b7d33 /packages/SettingsProvider
parent0329a0ea4a164138258976c94201e1f00aa2b17a (diff)
parent2f2184b755f995dcf661c383b520e4a36f8a432d (diff)
downloadframeworks_base-b20642b999bc7a73c8c69cc6a11984148ffaa383.zip
frameworks_base-b20642b999bc7a73c8c69cc6a11984148ffaa383.tar.gz
frameworks_base-b20642b999bc7a73c8c69cc6a11984148ffaa383.tar.bz2
am 2f2184b7: am 074dc2eb: Merge "Don\'t restore EAP-TLS networks from backup" into klp-dev
* commit '2f2184b755f995dcf661c383b520e4a36f8a432d': Don't restore EAP-TLS networks from backup
Diffstat (limited to 'packages/SettingsProvider')
-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 344446f..7b09092 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);
}
}