summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 84e1d95..f987fc5 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -125,7 +125,9 @@ public class LockPatternUtils {
private final ContentResolver mContentResolver;
private DevicePolicyManager mDevicePolicyManager;
private ILockSettings mLockSettingsService;
- private int mCurrentUserId = UserHandle.USER_NULL;
+
+ // The current user is set by KeyguardViewMediator and shared by all LockPatternUtils.
+ private static volatile int sCurrentUserId = UserHandle.USER_NULL;
public DevicePolicyManager getDevicePolicyManager() {
if (mDevicePolicyManager == null) {
@@ -215,13 +217,13 @@ public class LockPatternUtils {
}
public void setCurrentUser(int userId) {
- mCurrentUserId = userId;
+ sCurrentUserId = userId;
}
public int getCurrentUser() {
- if (mCurrentUserId != UserHandle.USER_NULL) {
+ if (sCurrentUserId != UserHandle.USER_NULL) {
// Someone is regularly updating using setCurrentUser() use that value.
- return mCurrentUserId;
+ return sCurrentUserId;
}
try {
return ActivityManagerNative.getDefault().getCurrentUser().id;