Merge "Remove UM.isUserOfType(userHandle) API"

This commit is contained in:
TreeHugger Robot
2020-01-30 22:23:40 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 31 deletions

View File

@@ -1775,9 +1775,10 @@ public class UserManager {
}
/**
* Returns whether the context user's user is of the given user type, such as
* {@link UserManager#USER_TYPE_FULL_GUEST}.
* Returns whether the context user is of the given user type.
*
* @param userType the name of the user's user type, e.g.
* {@link UserManager#USER_TYPE_PROFILE_MANAGED}.
* @return true if the user is of the given user type.
* @hide
*/
@@ -1792,26 +1793,6 @@ public class UserManager {
}
}
/**
* Returns whether the given user is of the given user type, such as
* {@link UserManager#USER_TYPE_FULL_GUEST}.
*
* @param userHandle the user handle of the user whose type is being requested.
* @param userType the name of the user's user type, e.g.
* {@link UserManager#USER_TYPE_PROFILE_MANAGED}.
* @return true if the userHandle user is of type userType
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public boolean isUserOfType(@NonNull UserHandle userHandle, @NonNull String userType) {
try {
return mService.isUserOfType(userHandle.getIdentifier(), userType);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
/**
* Returns whether the user type is a
* {@link UserManager#USER_TYPE_PROFILE_MANAGED managed profile}.