From 7ac52f42d2e46c8ae8e63f07f6d9fdc87ac02bdc Mon Sep 17 00:00:00 2001 From: Yasin Kilicdere Date: Tue, 1 Feb 2022 19:46:05 +0000 Subject: Remove allowedToRemoveOne boolean parameter from UM.getRemainingCreatableProfileCount() Bug: 217364189 Test: atest android.multiuser.cts.UserManagerTest Change-Id: Idebeab6407eb90967dcd0ebbcfaba4b76a8f1263 --- core/java/android/os/IUserManager.aidl | 2 +- core/java/android/os/UserManager.java | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/os/IUserManager.aidl b/core/java/android/os/IUserManager.aidl index d9c9a2b55abd..bc7fb789b538 100644 --- a/core/java/android/os/IUserManager.aidl +++ b/core/java/android/os/IUserManager.aidl @@ -63,7 +63,7 @@ interface IUserManager { boolean isUserTypeEnabled(in String userType); boolean canAddMoreUsersOfType(in String userType); int getRemainingCreatableUserCount(in String userType); - int getRemainingCreatableProfileCount(in String userType, int userId, boolean allowedToRemoveOne); + int getRemainingCreatableProfileCount(in String userType, int userId); boolean canAddMoreProfilesToUser(in String userType, int userId, boolean allowedToRemoveOne); boolean canAddMoreManagedProfiles(int userId, boolean allowedToRemoveOne); UserInfo getProfileParent(int userId); diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 7b8d34b3b570..2bd1dbb238e8 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -4055,9 +4055,6 @@ public class UserManager { *

Note that is applicable to any profile type (currently not including Restricted profiles). * * @param userType the type of profile, such as {@link UserManager#USER_TYPE_PROFILE_MANAGED}. - * @param allowedToRemoveOne whether removing an existing profile of given type -if there is- - * from the context user to make up space should be taken into account - * for the calculation. * @return how many additional profiles can be created. * @hide */ @@ -4068,13 +4065,11 @@ public class UserManager { android.Manifest.permission.QUERY_USERS }) @UserHandleAware - public int getRemainingCreatableProfileCount(@NonNull String userType, - boolean allowedToRemoveOne) { + public int getRemainingCreatableProfileCount(@NonNull String userType) { Objects.requireNonNull(userType, "userType must not be null"); try { // TODO(b/142482943): Perhaps let the following code apply to restricted users too. - return mService.getRemainingCreatableProfileCount(userType, mUserId, - allowedToRemoveOne); + return mService.getRemainingCreatableProfileCount(userType, mUserId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } -- cgit v1.2.3