Fixed ALLOWED_FLAGS_FOR_CREATE_USERS_PERMISSION to support full users and profiles.

Test: adb unroot && adb shell pm create-user --pre-create-only

Bug: 167698977
Bug: 168251532
Bug: 160252062
Bug: 168128662
Bug: 167454361

Change-Id: I48408233d6299007aacd38a67d9723b2b350d3c5
This commit is contained in:
Felipe Leme
2020-09-14 12:40:55 -07:00
committed by felipeal
parent e9897deb31
commit f6cc729457
2 changed files with 6 additions and 3 deletions

View File

@@ -2455,8 +2455,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;