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

Commit 4b7b5398 authored by Kasia Krejszeff's avatar Kasia Krejszeff Committed by Android (Google) Code Review
Browse files

Merge "Cleanup flag." into main

parents b38e11b4 258744a1
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
@@ -6866,12 +6866,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;
@@ -6882,8 +6880,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(