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

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

Merge "Allow ephemeral user creation via createAndManageUser"

parents e6dc7af2 1882302d
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -2439,12 +2439,6 @@ public class UserManagerService extends IUserManager.Stub {
                        return null;
                        return null;
                    }
                    }
                }
                }
                if (!UserManager.isSplitSystemUser() && (flags & UserInfo.FLAG_EPHEMERAL) != 0
                        && (flags & UserInfo.FLAG_DEMO) == 0) {
                    Log.e(LOG_TAG,
                            "Ephemeral users are supported on split-system-user systems only.");
                    return null;
                }
                // In split system user mode, we assign the first human user the primary flag.
                // In split system user mode, we assign the first human user the primary flag.
                // And if there is no device owner, we also assign the admin flag to primary user.
                // And if there is no device owner, we also assign the admin flag to primary user.
                if (UserManager.isSplitSystemUser()
                if (UserManager.isSplitSystemUser()
+0 −4
Original line number Original line Diff line number Diff line
@@ -8128,10 +8128,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        final boolean ephemeral = (flags & DevicePolicyManager.MAKE_USER_EPHEMERAL) != 0;
        final boolean ephemeral = (flags & DevicePolicyManager.MAKE_USER_EPHEMERAL) != 0;
        final boolean demo = (flags & DevicePolicyManager.MAKE_USER_DEMO) != 0
        final boolean demo = (flags & DevicePolicyManager.MAKE_USER_DEMO) != 0
                && UserManager.isDeviceInDemoMode(mContext);
                && UserManager.isDeviceInDemoMode(mContext);
        if (ephemeral && !mInjector.userManagerIsSplitSystemUser() && !demo) {
            throw new IllegalArgumentException(
                    "Ephemeral users are only supported on systems with a split system user.");
        }
        // Create user.
        // Create user.
        UserHandle user = null;
        UserHandle user = null;
        synchronized (this) {
        synchronized (this) {