Binder cache for isUserUnlocked update
Bug: 154434809 This change ensures that the isUserUnlocked binder cache will be invalidated when a new UserManagerService or StorageManagerService is created. Note that the bug cannot be reproduced at will so it is not known if this change actually fixes the bug (which has multiple potential root causes). However, by inspection, this change is desirable. Test: Run tests with an instrumented build. No cache inconsistencies were found: * UserManagerServiceCreateProfileTest * UserSystemPackageInstallerTest * UserManagerServiceUserInfoTest * UserManagerServiceIdRecyclingTest * PtsChreTestCases * UserLifecycleTests Change-Id: Ibc1204ccc1458028d94f2a64cbdc8ec1234b1ef3
This commit is contained in:
@@ -376,6 +376,7 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
private class WatchedLockedUsers {
|
||||
private int[] users = EmptyArray.INT;
|
||||
public WatchedLockedUsers() {
|
||||
invalidateIsUserUnlockedCache();
|
||||
}
|
||||
public void append(int userId) {
|
||||
users = ArrayUtils.appendInt(users, userId);
|
||||
|
||||
@@ -491,6 +491,7 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
final SparseIntArray states;
|
||||
public WatchedUserStates() {
|
||||
states = new SparseIntArray();
|
||||
invalidateIsUserUnlockedCache();
|
||||
}
|
||||
public int get(int userId) {
|
||||
return states.get(userId);
|
||||
|
||||
Reference in New Issue
Block a user