Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +25 −21 Original line number Diff line number Diff line Loading @@ -7844,6 +7844,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { throw new SecurityException("Cannot wipe data. " + restriction + " restriction is set for user " + userId); } }); boolean isSystemUser = userId == UserHandle.USER_SYSTEM; boolean wipeDevice; Loading @@ -7865,6 +7866,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { getAffectedUser(calledOnParentInstance)); wipeDevice = true; } else { mInjector.binderWithCleanCallingIdentity(() -> { Preconditions.checkCallAuthorization(!isSystemUser, "User %s is a system user and cannot be removed", userId); boolean isLastNonHeadlessUser = getUserInfo(userId).isFull() Loading @@ -7875,9 +7877,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { "Removing user %s would leave the device without any active users. " + "Consider factory resetting the device instead.", userId); }); wipeDevice = false; } } mInjector.binderWithCleanCallingIdentity(() -> { if (wipeDevice) { forceWipeDeviceNoLock( (flags & WIPE_EXTERNAL_STORAGE) != 0, Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +25 −21 Original line number Diff line number Diff line Loading @@ -7844,6 +7844,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { throw new SecurityException("Cannot wipe data. " + restriction + " restriction is set for user " + userId); } }); boolean isSystemUser = userId == UserHandle.USER_SYSTEM; boolean wipeDevice; Loading @@ -7865,6 +7866,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { getAffectedUser(calledOnParentInstance)); wipeDevice = true; } else { mInjector.binderWithCleanCallingIdentity(() -> { Preconditions.checkCallAuthorization(!isSystemUser, "User %s is a system user and cannot be removed", userId); boolean isLastNonHeadlessUser = getUserInfo(userId).isFull() Loading @@ -7875,9 +7877,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { "Removing user %s would leave the device without any active users. " + "Consider factory resetting the device instead.", userId); }); wipeDevice = false; } } mInjector.binderWithCleanCallingIdentity(() -> { if (wipeDevice) { forceWipeDeviceNoLock( (flags & WIPE_EXTERNAL_STORAGE) != 0,