Loading core/java/android/os/UserManager.java +8 −3 Original line number Diff line number Diff line Loading @@ -3763,7 +3763,8 @@ public class UserManager { } private static final String CACHE_KEY_IS_USER_UNLOCKED_PROPERTY = "cache_key.is_user_unlocked"; PropertyInvalidatedCache.createPropertyName( PropertyInvalidatedCache.MODULE_SYSTEM, "is_user_unlocked"); private final PropertyInvalidatedCache<Integer, Boolean> mIsUserUnlockedCache = new PropertyInvalidatedCache<Integer, Boolean>( Loading Loading @@ -6694,7 +6695,9 @@ public class UserManager { } /* Cache key for anything that assumes that userIds cannot be re-used without rebooting. */ private static final String CACHE_KEY_STATIC_USER_PROPERTIES = "cache_key.static_user_props"; private static final String CACHE_KEY_STATIC_USER_PROPERTIES = PropertyInvalidatedCache.createPropertyName( PropertyInvalidatedCache.MODULE_SYSTEM, "static_user_props"); private final PropertyInvalidatedCache<Integer, String> mProfileTypeCache = new PropertyInvalidatedCache<Integer, String>(32, CACHE_KEY_STATIC_USER_PROPERTIES) { Loading @@ -6721,7 +6724,9 @@ public class UserManager { } /* Cache key for UserProperties object. */ private static final String CACHE_KEY_USER_PROPERTIES = "cache_key.user_properties"; private static final String CACHE_KEY_USER_PROPERTIES = PropertyInvalidatedCache.createPropertyName( PropertyInvalidatedCache.MODULE_SYSTEM, "user_properties"); // TODO: It would be better to somehow have this as static, so that it can work cross-context. private final PropertyInvalidatedCache<Integer, UserProperties> mUserPropertiesCache = Loading services/core/java/com/android/server/pm/UserManagerService.java +15 −0 Original line number Diff line number Diff line Loading @@ -1090,6 +1090,21 @@ public class UserManagerService extends IUserManager.Stub { mUser0Allocations = DBG_ALLOCATION ? new AtomicInteger() : null; mPrivateSpaceAutoLockSettingsObserver = new SettingsObserver(mHandler); emulateSystemUserModeIfNeeded(); initPropertyInvalidatedCaches(); } /** * This method is used to invalidate the caches at server statup, * so that caches can start working. */ private static final void initPropertyInvalidatedCaches() { if (android.multiuser.Flags.cachesNotInvalidatedAtStartReadOnly()) { UserManager.invalidateIsUserUnlockedCache(); UserManager.invalidateQuietModeEnabledCache(); UserManager.invalidateStaticUserProperties(); UserManager.invalidateUserPropertiesCache(); UserManager.invalidateUserSerialNumberCache(); } } private boolean doesDeviceHardwareSupportPrivateSpace() { Loading Loading
core/java/android/os/UserManager.java +8 −3 Original line number Diff line number Diff line Loading @@ -3763,7 +3763,8 @@ public class UserManager { } private static final String CACHE_KEY_IS_USER_UNLOCKED_PROPERTY = "cache_key.is_user_unlocked"; PropertyInvalidatedCache.createPropertyName( PropertyInvalidatedCache.MODULE_SYSTEM, "is_user_unlocked"); private final PropertyInvalidatedCache<Integer, Boolean> mIsUserUnlockedCache = new PropertyInvalidatedCache<Integer, Boolean>( Loading Loading @@ -6694,7 +6695,9 @@ public class UserManager { } /* Cache key for anything that assumes that userIds cannot be re-used without rebooting. */ private static final String CACHE_KEY_STATIC_USER_PROPERTIES = "cache_key.static_user_props"; private static final String CACHE_KEY_STATIC_USER_PROPERTIES = PropertyInvalidatedCache.createPropertyName( PropertyInvalidatedCache.MODULE_SYSTEM, "static_user_props"); private final PropertyInvalidatedCache<Integer, String> mProfileTypeCache = new PropertyInvalidatedCache<Integer, String>(32, CACHE_KEY_STATIC_USER_PROPERTIES) { Loading @@ -6721,7 +6724,9 @@ public class UserManager { } /* Cache key for UserProperties object. */ private static final String CACHE_KEY_USER_PROPERTIES = "cache_key.user_properties"; private static final String CACHE_KEY_USER_PROPERTIES = PropertyInvalidatedCache.createPropertyName( PropertyInvalidatedCache.MODULE_SYSTEM, "user_properties"); // TODO: It would be better to somehow have this as static, so that it can work cross-context. private final PropertyInvalidatedCache<Integer, UserProperties> mUserPropertiesCache = Loading
services/core/java/com/android/server/pm/UserManagerService.java +15 −0 Original line number Diff line number Diff line Loading @@ -1090,6 +1090,21 @@ public class UserManagerService extends IUserManager.Stub { mUser0Allocations = DBG_ALLOCATION ? new AtomicInteger() : null; mPrivateSpaceAutoLockSettingsObserver = new SettingsObserver(mHandler); emulateSystemUserModeIfNeeded(); initPropertyInvalidatedCaches(); } /** * This method is used to invalidate the caches at server statup, * so that caches can start working. */ private static final void initPropertyInvalidatedCaches() { if (android.multiuser.Flags.cachesNotInvalidatedAtStartReadOnly()) { UserManager.invalidateIsUserUnlockedCache(); UserManager.invalidateQuietModeEnabledCache(); UserManager.invalidateStaticUserProperties(); UserManager.invalidateUserPropertiesCache(); UserManager.invalidateUserSerialNumberCache(); } } private boolean doesDeviceHardwareSupportPrivateSpace() { Loading