summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/test-current.txt2
-rw-r--r--core/java/android/os/UserManager.java7
2 files changed, 6 insertions, 3 deletions
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index 637ad7680344..e42e52619320 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -2376,10 +2376,12 @@ package android.os {
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo createProfileForUser(@Nullable String, @NonNull String, int, int, @Nullable String[]);
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo createRestrictedProfile(@Nullable String);
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo createUser(@Nullable String, @NonNull String, int);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public java.util.List<android.content.pm.UserInfo> getAliveUsers();
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.os.UserHandle getBootUser();
method public int getMainDisplayIdAssignedToUser();
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public java.util.Set<java.lang.String> getPreInstallableSystemPackages(@NonNull String);
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS, android.Manifest.permission.QUERY_USERS}) public String getUserType();
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public java.util.List<android.content.pm.UserInfo> getUsers();
method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public java.util.List<android.content.pm.UserInfo> getUsers(boolean, boolean, boolean);
method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean hasBaseUserRestriction(@NonNull String, @NonNull android.os.UserHandle);
method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isUserTypeEnabled(@NonNull String);
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 5bcbaa10e95b..8606687d8c68 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -4224,7 +4224,8 @@ public class UserManager {
android.Manifest.permission.MANAGE_USERS,
android.Manifest.permission.CREATE_USERS
})
- public List<UserInfo> getUsers() {
+ @TestApi
+ public @NonNull List<UserInfo> getUsers() {
return getUsers(/*excludePartial= */ true, /* excludeDying= */ false,
/* excludePreCreated= */ true);
}
@@ -4245,6 +4246,7 @@ public class UserManager {
android.Manifest.permission.MANAGE_USERS,
android.Manifest.permission.CREATE_USERS
})
+ @TestApi
public @NonNull List<UserInfo> getAliveUsers() {
return getUsers(/*excludePartial= */ true, /* excludeDying= */ true,
/* excludePreCreated= */ true);
@@ -4271,8 +4273,7 @@ public class UserManager {
* Returns information for all users on this device, based on the filtering parameters.
*
* @deprecated Pre-created users are deprecated and no longer supported.
- * Use {@link #getUsers()}, {@link #getUsers(boolean)}, or {@link #getAliveUsers()}
- * instead.
+ * Use {@link #getUsers()}, or {@link #getAliveUsers()} instead.
* @hide
*/
@Deprecated