Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 219d21d8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Removing enforcePermissionsAndGetEnforcingAdmin from ...

Merge "Removing enforcePermissionsAndGetEnforcingAdmin from  cleanCallingIdentity block" into udc-dev am: c831c399 am: a4b334cf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23600711



Change-Id: If04e41a994cf0f7b2e66f9ebe963621690d8cf75
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b9fea93b a4b334cf
Loading
Loading
Loading
Loading
+25 −21
Original line number Diff line number Diff line
@@ -7840,6 +7840,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;
@@ -7861,6 +7862,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()
@@ -7871,9 +7873,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,