Eliminate useless 'isManagedProfile' utils method
This exists in UserManager now Change-Id: If35326a1fe0de3c7bfde842c5c170899dc5d819b
This commit is contained in:
@@ -612,15 +612,6 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current profile is a managed one.
|
||||
*
|
||||
* @throws IllegalArgumentException if userManager is null.
|
||||
*/
|
||||
public static boolean isManagedProfile(@NonNull UserManager userManager) {
|
||||
return isManagedProfile(userManager, UserHandle.myUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the id for the given user's managed profile.
|
||||
*
|
||||
@@ -636,19 +627,6 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
return UserHandle.USER_NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the userId passed in is a managed profile.
|
||||
*
|
||||
* @throws IllegalArgumentException if userManager is null.
|
||||
*/
|
||||
public static boolean isManagedProfile(@NonNull UserManager userManager, int userId) {
|
||||
if (userManager == null) {
|
||||
throw new IllegalArgumentException("userManager must not be null");
|
||||
}
|
||||
UserInfo userInfo = userManager.getUserInfo(userId);
|
||||
return (userInfo != null) ? userInfo.isManagedProfile() : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target user for a Settings activity.
|
||||
*
|
||||
|
Reference in New Issue
Block a user