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

Commit 0091e8fe authored by Melody Hsu's avatar Melody Hsu Committed by Android (Google) Code Review
Browse files

Merge "Update captureDisplay flag to be read-only." into main

parents 324e5d6a 31c76e00
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ flag {

flag {
    namespace: "window_surfaces"
    name: "remove_capture_display"
    description: "Remove uses of ScreenCapture#captureDisplay"
    name: "delete_capture_display"
    description: "Delete uses of ScreenCapture#captureDisplay"
    is_fixed_read_only: true
    bug: "293445881"
}
+3 −3
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLEAR_ACCE
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_LONG_CLICK;

import static com.android.window.flags.Flags.removeCaptureDisplay;
import static com.android.window.flags.Flags.deleteCaptureDisplay;

import android.accessibilityservice.AccessibilityGestureEvent;
import android.accessibilityservice.AccessibilityService;
@@ -1443,7 +1443,7 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ
            return;
        }
        final long identity = Binder.clearCallingIdentity();
        if (removeCaptureDisplay()) {
        if (deleteCaptureDisplay()) {
            try {
                ScreenCapture.ScreenCaptureListener screenCaptureListener = new
                        ScreenCapture.ScreenCaptureListener(
@@ -1485,7 +1485,7 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ

    private void sendScreenshotSuccess(ScreenshotHardwareBuffer screenshotBuffer,
            RemoteCallback callback) {
        if (removeCaptureDisplay()) {
        if (deleteCaptureDisplay()) {
            mMainHandler.post(PooledLambda.obtainRunnable((nonArg) -> {
                final HardwareBuffer hardwareBuffer = screenshotBuffer.getHardwareBuffer();
                final ParcelableColorSpace colorSpace =
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_SCREEN_ROTATI
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.utils.CoordinateTransforms.computeRotationMatrix;
import static com.android.window.flags.Flags.removeCaptureDisplay;
import static com.android.window.flags.Flags.deleteCaptureDisplay;

import android.animation.ArgbEvaluator;
import android.content.Context;
@@ -171,7 +171,7 @@ class ScreenRotationAnimation {

        try {
            final ScreenCapture.ScreenshotHardwareBuffer screenshotBuffer;
            if (isSizeChanged && !removeCaptureDisplay()) {
            if (isSizeChanged && !deleteCaptureDisplay()) {
                final DisplayAddress address = displayInfo.address;
                if (!(address instanceof DisplayAddress.Physical)) {
                    Slog.e(TAG, "Display does not have a physical address: " + displayId);