Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +14 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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; } } Loading Loading @@ -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); } } Loading Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +14 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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; } } Loading Loading @@ -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); } } Loading