summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-10-03 02:41:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-10-03 02:41:30 +0000
commit855a7a989b439f819e86345d75207b676a882c33 (patch)
tree9489f39661295026e1d4ea335ef3742ecf95c3d8 /service
parent935cf49aaff145ce906fabfb6c0684c9aa8b950e (diff)
parentd2f873f0b74aef8da222c59e2081beaf2bbaf110 (diff)
Merge changes I601bc725,I1bd0ab91
* changes: Resetting SIM identity after store is read Update SIM status when SIM is removed
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java33
1 files changed, 18 insertions, 15 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 0b70dbf4e..c8c4844cc 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -2463,21 +2463,22 @@ public class WifiConfigManager {
*/
public void resetSimNetworks(boolean simPresent) {
if (mVerboseLoggingEnabled) localLog("resetSimNetworks");
- for (WifiConfiguration config : getInternalConfiguredNetworks()) {
- if (TelephonyUtil.isSimConfig(config)) {
- Pair<String, String> currentIdentity = null;
- if (simPresent) {
- currentIdentity = TelephonyUtil.getSimIdentity(mTelephonyManager,
- new TelephonyUtil(), config);
- }
- // Update the loaded config
- if (currentIdentity == null) {
- Log.d(TAG, "Identity is null");
- return;
- }
- config.enterpriseConfig.setIdentity(currentIdentity.first);
- if (config.enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.PEAP) {
- config.enterpriseConfig.setAnonymousIdentity("");
+ if (simPresent) {
+ for (WifiConfiguration config : getInternalConfiguredNetworks()) {
+ if (TelephonyUtil.isSimConfig(config)) {
+ Pair<String, String> currentIdentity =
+ TelephonyUtil.getSimIdentity(mTelephonyManager,
+ new TelephonyUtil(), config);
+
+ // Update the loaded config
+ if (currentIdentity == null) {
+ Log.d(TAG, "Identity is null");
+ break;
+ }
+ config.enterpriseConfig.setIdentity(currentIdentity.first);
+ if (config.enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.PEAP) {
+ config.enterpriseConfig.setAnonymousIdentity("");
+ }
}
}
}
@@ -2732,6 +2733,8 @@ public class WifiConfigManager {
if (mConfiguredNetworks.sizeForAllUsers() == 0) {
Log.w(TAG, "No stored networks found.");
}
+ // resetSimNetworks may already have been called. Call it again to reset loaded SIM configs.
+ resetSimNetworks(mSimPresent);
sendConfiguredNetworksChangedBroadcast();
mPendingStoreRead = false;
}