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

Commit 258744a1 authored by Kasia Krejszeff's avatar Kasia Krejszeff
Browse files

Cleanup flag.

Cleanup the android.multiuser.ignore_restrictions_when_deleting_private_profile flag.

Fix: 409607278
Flag: EXEMPT removing android.multiuser.ignore_restrictions_when_deleting_private_profile
Test: atest com.android.server.pm.UserManagerTest
Change-Id: I8dc44ff29ddc7fb618cbad6c6848e4d5e4b3184b
parent 9b769d46
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -429,16 +429,6 @@ flag {
  }
}

flag {
  name: "ignore_restrictions_when_deleting_private_profile"
  namespace: "profile_experiences"
  description: "Ignore any user restrictions when deleting private profiles."
  bug: "350953833"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
    name: "add_launcher_user_config"
    namespace: "profile_experiences"
+5 −8
Original line number Diff line number Diff line
@@ -6865,12 +6865,10 @@ public class UserManagerService extends IUserManager.Stub {
    }

    /**
     * Returns an optional string name of the restriction to check for user removal. The restriction
     * name varies depending on whether the user is a managed profile.
     *
     * <p>If the flag android.multiuser.ignore_restrictions_when_deleting_private_profile is enabled
     * and the user is a private profile (i.e. has no removal restrictions) the method will return
     * {@code Optional.empty()}.
     * Returns an optional string name of the restriction to check for user removal or {@code
     * Optional.empty()} if the user is a private profile (i.e. has no removal restrictions). The
     * restriction name for non private profiles varies depending on whether the user is a managed
     * profile.
     */
    private Optional<String> getUserRemovalRestrictionOptional(@UserIdInt int userId) {
        final boolean isPrivateProfile;
@@ -6881,8 +6879,7 @@ public class UserManagerService extends IUserManager.Stub {
        }
        isPrivateProfile = userInfo != null && userInfo.isPrivateProfile();
        isManagedProfile = userInfo != null && userInfo.isManagedProfile();
        if (android.multiuser.Flags.ignoreRestrictionsWhenDeletingPrivateProfile()
                && isPrivateProfile) {
        if (isPrivateProfile) {
            return Optional.empty();
        }
        return Optional.of(
+0 −2
Original line number Diff line number Diff line
@@ -650,8 +650,6 @@ public final class UserManagerTest {

    @MediumTest
    @Test
    @RequiresFlagsEnabled(
            android.multiuser.Flags.FLAG_IGNORE_RESTRICTIONS_WHEN_DELETING_PRIVATE_PROFILE)
    public void testRemoveUser_shouldRemovePrivateUser_withDisallowRemoveUserRestriction() {
        UserHandle mainUser = mUserManager.getMainUser();
        mUserManager.setUserRestriction(