Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -12303,9 +12303,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } final CallerIdentity caller = getCallerIdentity(admin); final CallerIdentity caller = getCallerIdentity(admin); // Only allow the system user to use this method Preconditions.checkCallAuthorization(caller.getUserHandle().isSystem(), "createAndManageUser was called from non-system user"); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_CREATE_AND_MANAGE_USER); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_CREATE_AND_MANAGE_USER); Loading @@ -12316,6 +12313,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { "createAndManageUser was called while in headless single user mode"); "createAndManageUser was called while in headless single user mode"); } } // Only allow the system user to use this method Preconditions.checkCallAuthorization(caller.getUserHandle().isSystem(), "createAndManageUser was called from non-system user"); 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); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -12303,9 +12303,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } final CallerIdentity caller = getCallerIdentity(admin); final CallerIdentity caller = getCallerIdentity(admin); // Only allow the system user to use this method Preconditions.checkCallAuthorization(caller.getUserHandle().isSystem(), "createAndManageUser was called from non-system user"); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_CREATE_AND_MANAGE_USER); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_CREATE_AND_MANAGE_USER); Loading @@ -12316,6 +12313,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { "createAndManageUser was called while in headless single user mode"); "createAndManageUser was called while in headless single user mode"); } } // Only allow the system user to use this method Preconditions.checkCallAuthorization(caller.getUserHandle().isSystem(), "createAndManageUser was called from non-system user"); 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);