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

Commit 973849d0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 2e2bd28e f6cc7294
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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"
+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;