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

Commit 8e1ad154 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix bug in createAndManageUser on non hsum devices" into main

parents 3e7ded88 4458ad7f
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -12320,7 +12320,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        if (Flags.headlessDeviceOwnerSingleUserEnabled()) {
            // Block this method if the device is in headless main user mode
            Preconditions.checkCallAuthorization(
                    getHeadlessDeviceOwnerModeForDeviceOwner()
                    !mInjector.userManagerIsHeadlessSystemUserMode()
                            || getHeadlessDeviceOwnerModeForDeviceOwner()
                            != HEADLESS_DEVICE_OWNER_MODE_SINGLE_USER,
                    "createAndManageUser was called while in headless single user mode");
        }
@@ -23319,11 +23320,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }
    private boolean hasAdminPolicy(int adminPolicy, String callerPackageName) {
        synchronized (getLockObject()) {
            CallerIdentity caller = getCallerIdentity(callerPackageName);
            ActiveAdmin deviceAdmin = getActiveAdminWithPolicyForUidLocked(
                    null, adminPolicy, caller.getUid());
            return deviceAdmin != null;
        }
    }
    /**
     * Return whether the calling process has been granted permission to apply a device policy on