Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa10285b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Flag removal: CacheProfilesReadOnly" into main

parents 69e43f0e a6ace17a
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -177,17 +177,6 @@ flag {
  is_fixed_read_only: true
}

flag {
    name: "cache_profiles_read_only"
    namespace: "multiuser"
    description: "Cache getProfiles to avoid unnecessary binder calls"
    bug: "350419395"
    metadata {
        purpose: PURPOSE_BUGFIX
  }
  is_fixed_read_only: true
}

flag {
    name: "cache_user_properties_correctly_read_only"
    namespace: "multiuser"
+1 −9
Original line number Diff line number Diff line
@@ -5440,17 +5440,10 @@ public class UserManager {
            Manifest.permission.QUERY_USERS}, conditional = true)
    @CachedProperty(api = "user_manager_user_data")
    public List<UserInfo> getProfiles(@UserIdInt int userId) {
        if (android.multiuser.Flags.cacheProfilesReadOnly()) {
            return UserManagerCache.getProfiles(
                    (Integer userIdentifier) -> mService.getProfiles(userIdentifier, false),
                    userId);
    }
        try {
            return mService.getProfiles(userId, false /* enabledOnly */);
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
        }
    }

    /**
     * Returns a list of the users that are associated with userId, including userId itself,
@@ -6608,8 +6601,7 @@ public class UserManager {
     * @hide
     */
    public static final void invalidateCacheOnUserDataChanged() {
        if (android.multiuser.Flags.cacheProfilesReadOnly()
                || android.multiuser.Flags.cacheUserInfoReadOnly()) {
        if (android.multiuser.Flags.cacheUserInfoReadOnly()) {
            // TODO(b/383175685): Rename the invalidation call to make it clearer that it
            // invalidates the caches for both getProfiles and getUserInfo (since they both use the
            // same user_manager_user_data CachedProperty.api).