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

Commit d5437349 authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Android (Google) Code Review
Browse files

Merge "Remove SCREEN_CAPTURE_DISABLED" into main

parents b538195b b540aac6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -8834,7 +8834,6 @@ package android.app.admin {
    field @FlaggedApi("android.app.admin.flags.policy_streamlining") @NonNull public static final android.app.admin.PolicyIdentifier<java.lang.Integer> SCREEN_CAPTURE;
    field @FlaggedApi("android.app.admin.flags.policy_streamlining") public static final int SCREEN_CAPTURE_ALLOWED = 2; // 0x2
    field @FlaggedApi("android.app.admin.flags.policy_streamlining") public static final int SCREEN_CAPTURE_BLOCKED = 1; // 0x1
    field @Deprecated @FlaggedApi("android.app.admin.flags.policy_streamlining") @NonNull public static final android.app.admin.PolicyIdentifier<java.lang.Boolean> SCREEN_CAPTURE_DISABLED;
  }
  public abstract class PolicyUpdateReceiver extends android.content.BroadcastReceiver {
+0 −27
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.TestApi;
import android.processor.devicepolicy.BooleanPolicyDefinition;
import android.processor.devicepolicy.EnumPolicyDefinition;
import android.processor.devicepolicy.PolicyDefinition;

@@ -81,32 +80,6 @@ public final class PolicyIdentifier<T> {
        return mId;
    }

    /* Compatible with the existing definition */
    private static final String SCREEN_CAPTURE_DISABLED_KEY =
            DevicePolicyIdentifiers.SCREEN_CAPTURE_DISABLED_POLICY;

    /**
     * Policy that controls whether the screen capture is disabled. Disabling
     * screen capture also prevents the content from being shown on display devices that do not have
     * a secure video output. See {@link android.view.Display#FLAG_SECURE} for more details about
     * secure surfaces and secure displays.
     * Throws SecurityException if the caller is not permitted to control screen capture policy.
     * If the scope is set to {@link DevicePolicyManager.POLICY_SCOPE_PARENT_USER} and the caller
     * is not a profile owner of an organization-owned managed profile, a security exception will
     * be thrown.
     *
     * @deprecated Use {@link SCREEN_CAPTURE} instead.
     */
    @FlaggedApi(FLAG_POLICY_STREAMLINING)
    @Deprecated
    @NonNull
    @BooleanPolicyDefinition(
            base = @PolicyDefinition
    )
    // TODO(b/440992241): Remove this definition after we confirm it's not used yet.
    public static final PolicyIdentifier<Boolean> SCREEN_CAPTURE_DISABLED = new PolicyIdentifier<>(
            SCREEN_CAPTURE_DISABLED_KEY);

    /**
     * Block screen capture. See {@link android.view.Display#FLAG_SECURE} for more details on how
     * blocking works.
+1 −7
Original line number Diff line number Diff line
@@ -24838,13 +24838,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        CallerIdentity caller = getCallerIdentity(callerPackageName);
        Binder.withCleanCallingIdentity(() -> {
            if (id.equals(PolicyIdentifier.SCREEN_CAPTURE_DISABLED.getId())) {
                if (value.getTag() != PolicyValueTransport.Tag.booleanField) {
                    throw new IllegalArgumentException(
                            "SCREEN_CAPTURE_DISABLED requires a Boolean value");
                }
                setScreenCaptureDisabled(caller, scope, value.getBooleanField());
            } else if (id.equals(PolicyIdentifier.SCREEN_CAPTURE.getId())) {
            if (id.equals(PolicyIdentifier.SCREEN_CAPTURE.getId())) {
                if (value.getTag() != PolicyValueTransport.Tag.integerField) {
                    throw new IllegalArgumentException("SCREEN_CAPTURE requires an Integer value");
                }