Loading services/core/java/com/android/server/pm/UserManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -1833,6 +1833,11 @@ public class UserManagerService extends IUserManager.Stub { return null; } } if (!UserManager.isSplitSystemUser() && (flags & UserInfo.FLAG_EPHEMERAL) != 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() Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -4968,6 +4968,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return; } Preconditions.checkNotNull(who, "ComponentName is null"); // Allow setting this policy to true only if there is a split system user. if (forceEphemeralUsers && !mInjector.userManagerIsSplitSystemUser()) { throw new IllegalArgumentException( "Cannot force ephemeral users on systems without split system user."); } boolean removeAllUsers = false; synchronized (this) { final ActiveAdmin deviceOwner = Loading Loading @@ -6818,6 +6823,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!mInjector.binderGetCallingUserHandle().isSystem()) { throw new SecurityException("createAndManageUser was called from non-system user"); } if (!mInjector.userManagerIsSplitSystemUser() && (flags & DevicePolicyManager.MAKE_USER_EPHEMERAL) != 0) { throw new IllegalArgumentException( "Ephemeral users are only supported on systems with a split system user."); } // Create user. UserHandle user = null; synchronized (this) { Loading Loading
services/core/java/com/android/server/pm/UserManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -1833,6 +1833,11 @@ public class UserManagerService extends IUserManager.Stub { return null; } } if (!UserManager.isSplitSystemUser() && (flags & UserInfo.FLAG_EPHEMERAL) != 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() Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -4968,6 +4968,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return; } Preconditions.checkNotNull(who, "ComponentName is null"); // Allow setting this policy to true only if there is a split system user. if (forceEphemeralUsers && !mInjector.userManagerIsSplitSystemUser()) { throw new IllegalArgumentException( "Cannot force ephemeral users on systems without split system user."); } boolean removeAllUsers = false; synchronized (this) { final ActiveAdmin deviceOwner = Loading Loading @@ -6818,6 +6823,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!mInjector.binderGetCallingUserHandle().isSystem()) { throw new SecurityException("createAndManageUser was called from non-system user"); } if (!mInjector.userManagerIsSplitSystemUser() && (flags & DevicePolicyManager.MAKE_USER_EPHEMERAL) != 0) { throw new IllegalArgumentException( "Ephemeral users are only supported on systems with a split system user."); } // Create user. UserHandle user = null; synchronized (this) { Loading