Merge "New @SystemApi: UserManager.getVisibleUsers()"
This commit is contained in:
@@ -129,6 +129,7 @@ interface IUserManager {
|
||||
boolean isUserRunning(int userId);
|
||||
boolean isUserForeground(int userId);
|
||||
boolean isUserVisible(int userId);
|
||||
List<UserHandle> getVisibleUsers();
|
||||
boolean isUserNameSet(int userId);
|
||||
boolean hasRestrictedProfiles(int userId);
|
||||
boolean requestQuietModeEnabled(String callingPackage, boolean enableQuietMode, int userId, in IntentSender target, int flags);
|
||||
|
||||
@@ -2885,6 +2885,21 @@ public class UserManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the visible users (as defined by {@link #isUserVisible()}.
|
||||
*
|
||||
* @return visible users at the moment.
|
||||
*/
|
||||
@RequiresPermission(anyOf = {Manifest.permission.MANAGE_USERS,
|
||||
Manifest.permission.INTERACT_ACROSS_USERS})
|
||||
public @NonNull List<UserHandle> getVisibleUsers() {
|
||||
try {
|
||||
return mService.getVisibleUsers();
|
||||
} catch (RemoteException re) {
|
||||
throw re.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the context user is running in an "unlocked" state.
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user