summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WifiConfigManager.java
diff options
context:
space:
mode:
authorDaichi Ueura <daichi.ueura@sony.com>2018-02-14 18:01:12 +0900
committerJong Wook Kim <jongwook@google.com>2018-03-08 01:18:08 +0000
commit9aa71c66945b6b6d46417077019e5b10a751564c (patch)
treecce94422ccf2799eb25ab31b0a4174aea3a1deda /service/java/com/android/server/wifi/WifiConfigManager.java
parent42f26dd680949e1d418d79f9cb0dc234ffd0d9ea (diff)
downloadandroid_frameworks_opt_net_wifi-9aa71c66945b6b6d46417077019e5b10a751564c.tar.gz
android_frameworks_opt_net_wifi-9aa71c66945b6b6d46417077019e5b10a751564c.tar.bz2
android_frameworks_opt_net_wifi-9aa71c66945b6b6d46417077019e5b10a751564c.zip
Make sure the user store is always ready
The user store is not setup properly if the user unlock comes in before loading from store at first time boot (e.g. just after factory reset). This patch moves the existing user store setup logic to the beginning of loadFromStore method to make sure it's always ready. Test: manual test Test: Wifi Integration Test Bug: 73419177 Signed-off-by: Akihiro Onodera <akihiro.onodera@sony.com> Change-Id: I51e936dcee54438a989c0f45138f015a9940d629
Diffstat (limited to 'service/java/com/android/server/wifi/WifiConfigManager.java')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 1cc0ee709..750b4e5c0 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -2758,6 +2758,14 @@ public class WifiConfigManager {
* false otherwise.
*/
public boolean loadFromStore() {
+ // 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;
+ }
if (!mWifiConfigStore.areStoresPresent()) {
Log.d(TAG, "New store files not found. No saved networks loaded!");
if (!mWifiConfigStoreLegacy.areStoresPresent()) {
@@ -2766,14 +2774,6 @@ 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) {