From 040829fe448045d12cbc90f6143aca7da6b5aa80 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Thu, 23 Feb 2017 13:36:41 -0800 Subject: 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 --- .../java/com/android/server/wifi/WifiConfigManager.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'service') 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; } -- cgit v1.2.3