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

Commit c926279c authored by Miranda Kephart's avatar Miranda Kephart Committed by Automerger Merge Worker
Browse files

Merge "Fix screenshot behavior with display cutout" into sc-dev am: a5e22cf5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13453317

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If29e315b3813f2cec30444effe703c879fa3b5c9
parents 5a0958bc a5e22cf5
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -388,12 +388,6 @@ public class ScreenshotController {
            }
        });

        // ignore system bar insets for the purpose of window layout
        mScreenshotView.setOnApplyWindowInsetsListener((v, insets) -> v.onApplyWindowInsets(
                new WindowInsets.Builder(insets)
                        .setInsets(WindowInsets.Type.all(), Insets.NONE)
                        .build()));

        // TODO(159460485): Remove this when focus is handled properly in the system
        mScreenshotView.setOnTouchListener((v, event) -> {
            if (event.getActionMasked() == MotionEvent.ACTION_OUTSIDE) {
@@ -533,9 +527,6 @@ public class ScreenshotController {


        attachWindow();
        if (DEBUG_WINDOW) {
            Log.d(TAG, "setContentView: " + mScreenshotView);
        }
        mScreenshotView.getViewTreeObserver().addOnPreDrawListener(
                new ViewTreeObserver.OnPreDrawListener() {
                    @Override
@@ -549,7 +540,13 @@ public class ScreenshotController {
                    }
                });
        mScreenshotView.setScreenshot(mScreenBitmap, screenInsets);
        if (DEBUG_WINDOW) {
            Log.d(TAG, "setContentView: " + mScreenshotView);
        }
        setContentView(mScreenshotView);
        // ignore system bar insets for the purpose of window layout
        mWindow.getDecorView().setOnApplyWindowInsetsListener(
                (v, insets) -> WindowInsets.CONSUMED);
        cancelTimeout(); // restarted after animation
    }