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

Commit 7ab8dd98 authored by Miranda Kephart's avatar Miranda Kephart Committed by Android (Google) Code Review
Browse files

Merge "Restore non-scrolling UI on long screenshots crash" into sc-dev

parents 6b9f1a5e d9674b58
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -676,12 +676,19 @@ public class ScreenshotController {
                            mScrollCaptureController.run(response);
                    future.addListener(() -> {
                        ScrollCaptureController.LongScreenshot longScreenshot;

                        try {
                            longScreenshot = future.get();
                        } catch (CancellationException
                                | InterruptedException
                                | ExecutionException e) {
                            Log.e(TAG, "Exception", e);
                            mScreenshotView.restoreNonScrollingUi();
                            return;
                        }

                        if (longScreenshot.getHeight() == 0) {
                            mScreenshotView.restoreNonScrollingUi();
                            return;
                        }

+17 −0
Original line number Diff line number Diff line
@@ -881,6 +881,23 @@ public class ScreenshotView extends FrameLayout implements
        anim.start();
    }

    void restoreNonScrollingUi() {
        mScrollChip.setVisibility(View.GONE);
        mScrollablePreview.setVisibility(View.GONE);
        mScrollingScrim.setVisibility(View.GONE);

        if (mAccessibilityManager.isEnabled()) {
            mDismissButton.setVisibility(View.VISIBLE);
        }
        mActionsContainer.setVisibility(View.VISIBLE);
        mBackgroundProtection.setVisibility(View.VISIBLE);
        mActionsContainerBackground.setVisibility(View.VISIBLE);
        mScreenshotPreviewBorder.setVisibility(View.VISIBLE);
        mScreenshotPreview.setVisibility(View.VISIBLE);
        // reset the timeout
        mCallbacks.onUserInteraction();
    }

    boolean isDismissing() {
        return (mDismissAnimation != null && mDismissAnimation.isRunning());
    }