Eliminate useless 'isManagedProfile' utils method

This exists in UserManager now

Change-Id: If35326a1fe0de3c7bfde842c5c170899dc5d819b
This commit is contained in:
Robin Lee
2016-09-12 16:25:28 +09:00
parent 162aa53133
commit 788671647c
12 changed files with 17 additions and 42 deletions

View File

@@ -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.
*