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

Commit 6c137496 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Always reset screenshot preview to alpha=1

It's possible for the screenshot process to not get shut down as
soon as the UI disappears. If this occurs after a shared transition
(which sets the preview to alpha=0 to hide it as part of the
transition), the preview gets stuck at alpha=0 and isn't visible.
Always resetting the screenshot view and setting alpha=1 guarantees
that regardless of the state of the screenshot process, we always
start from a clean slate.

Bug: 242862442
Test: forced the screenshot process to stay up by never running
the finish callback in ScreenshotHelper, verified that we get the
invisible-preview behavior and that it's fixed with this change

Change-Id: I9b795928cba93f8cef19244105db2c7f31c0973b
parent 60e003dd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -555,6 +555,8 @@ public class ScreenshotController {
                mScreenshotView.announceForAccessibility(
                        mContext.getResources().getString(R.string.screenshot_saving_title)));

        mScreenshotView.reset();

        if (mScreenshotView.isAttachedToWindow()) {
            // if we didn't already dismiss for another reason
            if (!mScreenshotView.isDismissing()) {
@@ -564,7 +566,6 @@ public class ScreenshotController {
                Log.d(TAG, "saveScreenshot: screenshotView is already attached, resetting. "
                        + "(dismissing=" + mScreenshotView.isDismissing() + ")");
            }
            mScreenshotView.reset();
        }
        mPackageName = topComponent == null ? "" : topComponent.getPackageName();
        mScreenshotView.setPackageName(mPackageName);
+1 −0
Original line number Diff line number Diff line
@@ -1006,6 +1006,7 @@ public class ScreenshotView extends FrameLayout implements
        // Clear any references to the bitmap
        mScreenshotPreview.setImageDrawable(null);
        mScreenshotPreview.setVisibility(View.INVISIBLE);
        mScreenshotPreview.setAlpha(1f);
        mScreenshotPreviewBorder.setAlpha(0);
        mPendingSharedTransition = false;
        mActionsContainerBackground.setVisibility(View.GONE);