Loading core/java/android/os/UserManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -2391,10 +2391,15 @@ public class UserManager { */ public static final int USER_OPERATION_ERROR_DISABLED_USER = 8; /** * Indicates user operation failed because user is disabled on the device. * Indicates user operation failed because private space is disabled on the device. * @hide */ public static final int USER_OPERATION_ERROR_PRIVATE_PROFILE = 9; /** * Indicates user operation failed because user is restricted on the device. * @hide */ public static final int USER_OPERATION_ERROR_USER_RESTRICTED = 10; /** * Result returned from various user operations. Loading @@ -2413,6 +2418,7 @@ public class UserManager { USER_OPERATION_ERROR_USER_ACCOUNT_ALREADY_EXISTS, USER_OPERATION_ERROR_DISABLED_USER, USER_OPERATION_ERROR_PRIVATE_PROFILE, USER_OPERATION_ERROR_USER_RESTRICTED, }) public @interface UserOperationResult {} Loading services/core/java/com/android/server/pm/UserManagerService.java +7 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static android.os.UserManager.DEV_CREATE_OVERRIDE_PROPERTY; import static android.os.UserManager.DISALLOW_USER_SWITCH; import static android.os.UserManager.SYSTEM_USER_MODE_EMULATION_PROPERTY; import static android.os.UserManager.USER_OPERATION_ERROR_UNKNOWN; import static android.os.UserManager.USER_OPERATION_ERROR_USER_RESTRICTED; import static android.os.UserManager.USER_TYPE_PROFILE_PRIVATE; import static com.android.internal.app.SetScreenLockDialogActivity.EXTRA_ORIGIN_USER_ID; Loading Loading @@ -8039,10 +8040,15 @@ public class UserManagerService extends IUserManager.Stub { String errorMessage = (message != null ? (message + ": ") : "") + restriction + " is enabled."; Slog.w(LOG_TAG, errorMessage); if (android.multiuser.Flags.showDifferentCreationErrorForUnsupportedDevices()) { throw new UserManager.CheckedUserOperationException(errorMessage, USER_OPERATION_ERROR_USER_RESTRICTED); } else { throw new UserManager.CheckedUserOperationException(errorMessage, USER_OPERATION_ERROR_UNKNOWN); } } } /** * Throws CheckedUserOperationException and shows error log Loading Loading
core/java/android/os/UserManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -2391,10 +2391,15 @@ public class UserManager { */ public static final int USER_OPERATION_ERROR_DISABLED_USER = 8; /** * Indicates user operation failed because user is disabled on the device. * Indicates user operation failed because private space is disabled on the device. * @hide */ public static final int USER_OPERATION_ERROR_PRIVATE_PROFILE = 9; /** * Indicates user operation failed because user is restricted on the device. * @hide */ public static final int USER_OPERATION_ERROR_USER_RESTRICTED = 10; /** * Result returned from various user operations. Loading @@ -2413,6 +2418,7 @@ public class UserManager { USER_OPERATION_ERROR_USER_ACCOUNT_ALREADY_EXISTS, USER_OPERATION_ERROR_DISABLED_USER, USER_OPERATION_ERROR_PRIVATE_PROFILE, USER_OPERATION_ERROR_USER_RESTRICTED, }) public @interface UserOperationResult {} Loading
services/core/java/com/android/server/pm/UserManagerService.java +7 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static android.os.UserManager.DEV_CREATE_OVERRIDE_PROPERTY; import static android.os.UserManager.DISALLOW_USER_SWITCH; import static android.os.UserManager.SYSTEM_USER_MODE_EMULATION_PROPERTY; import static android.os.UserManager.USER_OPERATION_ERROR_UNKNOWN; import static android.os.UserManager.USER_OPERATION_ERROR_USER_RESTRICTED; import static android.os.UserManager.USER_TYPE_PROFILE_PRIVATE; import static com.android.internal.app.SetScreenLockDialogActivity.EXTRA_ORIGIN_USER_ID; Loading Loading @@ -8039,10 +8040,15 @@ public class UserManagerService extends IUserManager.Stub { String errorMessage = (message != null ? (message + ": ") : "") + restriction + " is enabled."; Slog.w(LOG_TAG, errorMessage); if (android.multiuser.Flags.showDifferentCreationErrorForUnsupportedDevices()) { throw new UserManager.CheckedUserOperationException(errorMessage, USER_OPERATION_ERROR_USER_RESTRICTED); } else { throw new UserManager.CheckedUserOperationException(errorMessage, USER_OPERATION_ERROR_UNKNOWN); } } } /** * Throws CheckedUserOperationException and shows error log Loading