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

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

Merge "Fix DPM.getScreenCaptureDisabled on parent user" into main

parents 5d35661d edab0461
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -8909,11 +8909,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        if (parent) {
            Preconditions.checkCallAuthorization(
                    isProfileOwnerOfOrganizationOwnedDevice(getCallerIdentity().getUserId()));
                    isProfileOwnerOfOrganizationOwnedDevice(caller.getUserId()));
            // If a DPC is querying on the parent instance, make sure it's only querying the parent
            // user of itself. Querying any other user is not allowed.
            Preconditions.checkArgument(caller.getUserId() == userHandle);
        }
        int affectedUserId = parent ? getProfileParentId(userHandle) : userHandle;
        Boolean disallowed = mDevicePolicyEngine.getResolvedPolicy(
                PolicyDefinition.SCREEN_CAPTURE_DISABLED,
                userHandle);
                affectedUserId);
        return disallowed != null && disallowed;
    }