Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6cc7294 authored by Felipe Leme's avatar Felipe Leme Committed by felipeal
Browse files

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
parent e9897deb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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"
+3 −1
Original line number Diff line number Diff line
@@ -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;