UM.isUserTypeEnabled @TestApi
Make this API available for CTS tests. This way, for device-side tests,
you can tell tests to be skipped if their purpose involves creating a
profile for which the device isn't eligible anyway.
Test: N/A
Bug: 255793314
Bug: 255377177
Bug: 241298595
Bug: 257125968
Change-Id: I3a6d93f8092e327c9d6073e68e57d1eab2cfa127
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index e2690a9..8c4b133 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -1880,6 +1880,7 @@
method @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 public static boolean isSplitSystemUser();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isUserTypeEnabled(@NonNull String);
method public boolean isUsersOnSecondaryDisplaysSupported();
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo preCreateUser(@NonNull String) throws android.os.UserManager.UserOperationException;
}
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 51dc643..225ac13 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -4339,6 +4339,7 @@
* @return true if the creation of users of the given user type is enabled on this device.
* @hide
*/
+ @TestApi
@RequiresPermission(anyOf = {
android.Manifest.permission.MANAGE_USERS,
android.Manifest.permission.CREATE_USERS