Loading core/java/android/app/admin/DevicePolicyManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -4206,6 +4206,13 @@ public class DevicePolicyManager { */ public static final int SKIP_SETUP_WIZARD = 0x0001; /** * Flag used by {@link #createAndManageUser} to specify that the user should be created * ephemeral. * @hide */ public static final int MAKE_USER_EPHEMERAL = 0x0002; /** * Called by a device owner to create a user with the specified name and a given component of * the calling package as profile owner. The UserHandle returned by this method should not be Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -6525,7 +6525,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { final long id = mInjector.binderClearCallingIdentity(); try { UserInfo userInfo = mUserManager.createUser(name, 0 /* flags */); int userInfoFlags = 0; if ((flags & DevicePolicyManager.MAKE_USER_EPHEMERAL) != 0) { userInfoFlags |= UserInfo.FLAG_EPHEMERAL; } UserInfo userInfo = mUserManager.createUser(name, userInfoFlags); if (userInfo != null) { user = userInfo.getUserHandle(); } Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -4206,6 +4206,13 @@ public class DevicePolicyManager { */ public static final int SKIP_SETUP_WIZARD = 0x0001; /** * Flag used by {@link #createAndManageUser} to specify that the user should be created * ephemeral. * @hide */ public static final int MAKE_USER_EPHEMERAL = 0x0002; /** * Called by a device owner to create a user with the specified name and a given component of * the calling package as profile owner. The UserHandle returned by this method should not be Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -6525,7 +6525,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { final long id = mInjector.binderClearCallingIdentity(); try { UserInfo userInfo = mUserManager.createUser(name, 0 /* flags */); int userInfoFlags = 0; if ((flags & DevicePolicyManager.MAKE_USER_EPHEMERAL) != 0) { userInfoFlags |= UserInfo.FLAG_EPHEMERAL; } UserInfo userInfo = mUserManager.createUser(name, userInfoFlags); if (userInfo != null) { user = userInfo.getUserHandle(); } Loading