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

Commit b540aac6 authored by Victor Gabriel Savu's avatar Victor Gabriel Savu Committed by Jeroen Dhollander
Browse files

Remove SCREEN_CAPTURE_DISABLED

API was never released and was replaced with SCREEN_CAPTURE.

Bug: 440992241
Test: m
Flag: android.app.admin.flags.policy_streamlining
Change-Id: Ib1773f38344f94d35bf7a7d966b5d891629f04db
parent 67f59928
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
@@ -24826,13 +24826,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");
                }