Loading core/java/android/content/pm/multiuser.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading services/core/java/com/android/server/pm/UserManagerService.java +5 −8 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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( Loading services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -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( Loading Loading
core/java/android/content/pm/multiuser.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading
services/core/java/com/android/server/pm/UserManagerService.java +5 −8 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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( Loading
services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -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( Loading