Merge "Fixed ALLOWED_FLAGS_FOR_CREATE_USERS_PERMISSION to support full users and profiles."

This commit is contained in:
TreeHugger Robot
2020-09-22 02:33:49 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -2459,8 +2459,9 @@
android:protectionLevel="signature|privileged" />
<!-- @SystemApi @hide Allows an application to create, remove users and get the list of
users on the device. Applications holding this permission can only create restricted,
guest, managed, demo, and ephemeral users. For creating other kind of users,
users on the device. Applications holding this permission can create users (including
normal, restricted, guest, managed, and demo users) and can optionally endow them with the
ephemeral property. For creating users with other kinds of properties,
{@link android.Manifest.permission#MANAGE_USERS} is needed.
This permission is not available to third party applications. -->
<permission android:name="android.permission.CREATE_USERS"

View File

@@ -221,10 +221,12 @@ public class UserManagerService extends IUserManager.Stub {
private static final int ALLOWED_FLAGS_FOR_CREATE_USERS_PERMISSION =
UserInfo.FLAG_MANAGED_PROFILE
| UserInfo.FLAG_PROFILE
| UserInfo.FLAG_EPHEMERAL
| UserInfo.FLAG_RESTRICTED
| UserInfo.FLAG_GUEST
| UserInfo.FLAG_DEMO;
| UserInfo.FLAG_DEMO
| UserInfo.FLAG_FULL;
@VisibleForTesting
static final int MIN_USER_ID = UserHandle.MIN_SECONDARY_USER_ID;