diff options
author | Roshan Pius <rpius@google.com> | 2019-03-28 12:42:03 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-03-29 12:41:25 -0700 |
commit | 6b3f8a279d1bd2cde761a9fee3d9c96436324b6f (patch) | |
tree | 2db66d6d26e7305e54ca1cdeb8d5f4e67bdeaa83 /service/java/com | |
parent | e5d7c64224453d5b7415babf6bf898195137d1f2 (diff) | |
download | android_frameworks_opt_net_wifi-6b3f8a279d1bd2cde761a9fee3d9c96436324b6f.tar.gz android_frameworks_opt_net_wifi-6b3f8a279d1bd2cde761a9fee3d9c96436324b6f.tar.bz2 android_frameworks_opt_net_wifi-6b3f8a279d1bd2cde761a9fee3d9c96436324b6f.zip |
WifiConfigManager: Ignore user unlock for non current user
Changes in the CL:
a) Ignore user unlock if the user id is not for current active user.
b) Reset the |mDeferredUserUnlockRead| on a user switch(
mDeferredUserUnlockRead might be set from a previous user unlock).
Bug: 129434351
Test: Ensured that the device persists the saved networks on reboot.
Test: Will send the patch to Android auto team to ensure that their
issue is resolved.
Test: atest com.android.server.wifi
Test: Will send for full regression.
Change-Id: If3c1dd8026323b8747d086a767e49a0d899ee990
Diffstat (limited to 'service/java/com')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 81b513920..701b010bd 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -2871,6 +2871,8 @@ public class WifiConfigManager { Log.w(TAG, "User switch before store is read!"); mConfiguredNetworks.setNewUser(userId); mCurrentUserId = userId; + // Reset any state from previous user unlock. + mDeferredUserUnlockRead = false; // Cannot read data from new user's CE store file before they log-in. mPendingUnlockStoreRead = true; return new HashSet<>(); @@ -2905,12 +2907,16 @@ public class WifiConfigManager { if (mVerboseLoggingEnabled) { Log.v(TAG, "Handling user unlock for " + userId); } + if (userId != mCurrentUserId) { + Log.e(TAG, "Ignore user unlock for non current user " + userId); + return; + } if (mPendingStoreRead) { Log.w(TAG, "Ignore user unlock until store is read!"); mDeferredUserUnlockRead = true; return; } - if (userId == mCurrentUserId && mPendingUnlockStoreRead) { + if (mPendingUnlockStoreRead) { handleUserUnlockOrSwitch(mCurrentUserId); } } |