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

Commit edab0461 authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix DPM.getScreenCaptureDisabled on parent user

Bug: 265431659
Test: ScreenCaptureDisabledTest
Flag: EXEMPT bugfix
Change-Id: I522e00ce48d5e80f7237e990b7cb2ee3fe4c4111
parent 8bd6ab3a
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;
    }