diff options
author | Christopher Tate <ctate@google.com> | 2015-11-17 18:01:52 -0800 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2015-12-10 18:23:22 -0800 |
commit | a89f9d93cbda665259812e990bca1045bd8abf9f (patch) | |
tree | 6b8849a119a41b2ac08c6cb3e47584ea74cabbf8 /packages/SettingsProvider | |
parent | 022c748f54626f77f01079595a0100d1d145f383 (diff) | |
download | frameworks_base-a89f9d93cbda665259812e990bca1045bd8abf9f.zip frameworks_base-a89f9d93cbda665259812e990bca1045bd8abf9f.tar.gz frameworks_base-a89f9d93cbda665259812e990bca1045bd8abf9f.tar.bz2 |
Don't back up / restore EAP network definitions
Bug 25725016
Cherrypick from AOSP.
Change-Id: I6aa11a76e7724a0aaad05a1aa074afa2c429370c
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java | 19 |
1 files changed, 19 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 b9a9c24..2e96f18 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java @@ -159,6 +159,7 @@ public class SettingsBackupAgent extends BackupAgentHelper { String key_mgmt = ""; boolean certUsed = false; boolean hasWepKey = false; + boolean isEap = false; final ArrayList<String> rawLines = new ArrayList<String>(); public static Network readFromStream(BufferedReader in) { @@ -189,6 +190,9 @@ public class SettingsBackupAgent extends BackupAgentHelper { ssid = line; } else if (line.startsWith("key_mgmt=")) { key_mgmt = line; + if (line.contains("EAP")) { + isEap = true; + } } else if (line.startsWith("client_cert=")) { certUsed = true; } else if (line.startsWith("ca_cert=")) { @@ -197,6 +201,8 @@ public class SettingsBackupAgent extends BackupAgentHelper { certUsed = true; } else if (line.startsWith("wep_")) { hasWepKey = true; + } else if (line.startsWith("eap=")) { + isEap = true; } } @@ -325,6 +331,13 @@ public class SettingsBackupAgent extends BackupAgentHelper { continue; } } + // Don't propagate EAP network definitions + if (net.isEap) { + if (DEBUG_BACKUP) { + Log.v(TAG, "Skipping EAP network " + net.ssid + " / " + net.key_mgmt); + } + continue; + } if (! mKnownNetworks.contains(net)) { if (DEBUG_BACKUP) { Log.v(TAG, "Adding " + net.ssid + " / " + net.key_mgmt); @@ -353,6 +366,12 @@ public class SettingsBackupAgent extends BackupAgentHelper { continue; } + if (net.isEap) { + // Similarly, omit EAP network definitions to avoid propagating + // controlled enterprise network definitions. + continue; + } + net.write(w); } } |