Loading services/core/java/com/android/server/am/UserController.java +8 −0 Original line number Diff line number Diff line Loading @@ -1477,6 +1477,10 @@ final class UserController { case UserState.STATE_RUNNING_UNLOCKING: case UserState.STATE_RUNNING_UNLOCKED: return true; // In the stopping/shutdown state return unlock state of the user key case UserState.STATE_STOPPING: case UserState.STATE_SHUTDOWN: return StorageManager.isUserKeyUnlocked(userId); default: return false; } Loading @@ -1485,6 +1489,10 @@ final class UserController { switch (state.state) { case UserState.STATE_RUNNING_UNLOCKED: return true; // In the stopping/shutdown state return unlock state of the user key case UserState.STATE_STOPPING: case UserState.STATE_SHUTDOWN: return StorageManager.isUserKeyUnlocked(userId); default: return false; } Loading services/core/java/com/android/server/pm/UserManagerService.java +16 −6 Original line number Diff line number Diff line Loading @@ -949,7 +949,7 @@ public class UserManagerService extends IUserManager.Stub { @Override public boolean isUserUnlocked(int userId) { checkManageOrInteractPermIfCallerInOtherProfileGroup(userId, "isUserUnlocked"); return mLocalService.isUserUnlockingOrUnlocked(userId); return mLocalService.isUserUnlocked(userId); } @Override Loading Loading @@ -3692,19 +3692,29 @@ public class UserManagerService extends IUserManager.Stub { @Override public boolean isUserUnlockingOrUnlocked(int userId) { int state; synchronized (mUserStates) { int state = mUserStates.get(userId, -1); state = mUserStates.get(userId, -1); } // Special case, in the stopping/shutdown state user key can still be unlocked if (state == UserState.STATE_STOPPING || state == UserState.STATE_SHUTDOWN) { return StorageManager.isUserKeyUnlocked(userId); } return (state == UserState.STATE_RUNNING_UNLOCKING) || (state == UserState.STATE_RUNNING_UNLOCKED); } } @Override public boolean isUserUnlocked(int userId) { int state; synchronized (mUserStates) { int state = mUserStates.get(userId, -1); return state == UserState.STATE_RUNNING_UNLOCKED; state = mUserStates.get(userId, -1); } // Special case, in the stopping/shutdown state user key can still be unlocked if (state == UserState.STATE_STOPPING || state == UserState.STATE_SHUTDOWN) { return StorageManager.isUserKeyUnlocked(userId); } return state == UserState.STATE_RUNNING_UNLOCKED; } } Loading Loading
services/core/java/com/android/server/am/UserController.java +8 −0 Original line number Diff line number Diff line Loading @@ -1477,6 +1477,10 @@ final class UserController { case UserState.STATE_RUNNING_UNLOCKING: case UserState.STATE_RUNNING_UNLOCKED: return true; // In the stopping/shutdown state return unlock state of the user key case UserState.STATE_STOPPING: case UserState.STATE_SHUTDOWN: return StorageManager.isUserKeyUnlocked(userId); default: return false; } Loading @@ -1485,6 +1489,10 @@ final class UserController { switch (state.state) { case UserState.STATE_RUNNING_UNLOCKED: return true; // In the stopping/shutdown state return unlock state of the user key case UserState.STATE_STOPPING: case UserState.STATE_SHUTDOWN: return StorageManager.isUserKeyUnlocked(userId); default: return false; } Loading
services/core/java/com/android/server/pm/UserManagerService.java +16 −6 Original line number Diff line number Diff line Loading @@ -949,7 +949,7 @@ public class UserManagerService extends IUserManager.Stub { @Override public boolean isUserUnlocked(int userId) { checkManageOrInteractPermIfCallerInOtherProfileGroup(userId, "isUserUnlocked"); return mLocalService.isUserUnlockingOrUnlocked(userId); return mLocalService.isUserUnlocked(userId); } @Override Loading Loading @@ -3692,19 +3692,29 @@ public class UserManagerService extends IUserManager.Stub { @Override public boolean isUserUnlockingOrUnlocked(int userId) { int state; synchronized (mUserStates) { int state = mUserStates.get(userId, -1); state = mUserStates.get(userId, -1); } // Special case, in the stopping/shutdown state user key can still be unlocked if (state == UserState.STATE_STOPPING || state == UserState.STATE_SHUTDOWN) { return StorageManager.isUserKeyUnlocked(userId); } return (state == UserState.STATE_RUNNING_UNLOCKING) || (state == UserState.STATE_RUNNING_UNLOCKED); } } @Override public boolean isUserUnlocked(int userId) { int state; synchronized (mUserStates) { int state = mUserStates.get(userId, -1); return state == UserState.STATE_RUNNING_UNLOCKED; state = mUserStates.get(userId, -1); } // Special case, in the stopping/shutdown state user key can still be unlocked if (state == UserState.STATE_STOPPING || state == UserState.STATE_SHUTDOWN) { return StorageManager.isUserKeyUnlocked(userId); } return state == UserState.STATE_RUNNING_UNLOCKED; } } Loading