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

Commit 1882302d authored by Benjamin Franz's avatar Benjamin Franz
Browse files

Allow ephemeral user creation via createAndManageUser

Ephemeral users where initially created for split system users. Make
them available on all systems. This CL is initially for evaluation
purpose to see how advanced they are in the current system.

Test: manual
Bug: 64381943
Change-Id: Ia9caa8e07037a64055f2033113806b8c559a75af
parent 9c6f4bfb
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -2439,12 +2439,6 @@ public class UserManagerService extends IUserManager.Stub {
                        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.
                // And if there is no device owner, we also assign the admin flag to primary user.
                if (UserManager.isSplitSystemUser()
+0 −4
Original line number 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 demo = (flags & DevicePolicyManager.MAKE_USER_DEMO) != 0
                && 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.
        UserHandle user = null;
        synchronized (this) {