summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@google.com>2017-02-23 13:36:41 -0800
committerPeter Qiu <zqiu@google.com>2017-03-02 14:12:21 -0800
commit040829fe448045d12cbc90f6143aca7da6b5aa80 (patch)
treed3035308193374554b4738393ad90ab47e599d5f /service
parent5e4822d5dba15e45c5ff43dfba3ac7803b3f4e28 (diff)
WifiConfigManager: setup user store when loadFromStore is triggered after user unlock
Instead of performing an user unlock/switch logic after reading from the store, we only need to setup the user store for the current user before performing the read. Bug: 35675098 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I6a8f2695d53c8a2ea8589e64c9dd8e867ae5415e
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index aea7c6ade..e79047cf3 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -2603,6 +2603,14 @@ public class WifiConfigManager {
}
return true;
}
+ // If the user unlock comes in before we load from store, which means the user store have
+ // not been setup yet for the current user. Setup the user store before the read so that
+ // configurations for the current user will also being loaded.
+ if (mDeferredUserUnlockRead) {
+ Log.i(TAG, "Handling user unlock before loading from store.");
+ mWifiConfigStore.setUserStore(WifiConfigStore.createUserFile(mCurrentUserId));
+ mDeferredUserUnlockRead = false;
+ }
try {
mWifiConfigStore.read();
} catch (IOException e) {
@@ -2615,13 +2623,6 @@ public class WifiConfigManager {
loadInternalData(mNetworkListStoreData.getSharedConfigurations(),
mNetworkListStoreData.getUserConfigurations(),
mDeletedEphemeralSsidsStoreData.getSsidList());
- // If the user unlock comes in before we load from store, we defer the handling until
- // the load from store is triggered.
- if (mDeferredUserUnlockRead) {
- Log.i(TAG, "Handling user unlock after loading from store.");
- handleUserUnlockOrSwitch(mCurrentUserId);
- mDeferredUserUnlockRead = false;
- }
return true;
}