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

Commit 131ae0a0 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Start screenshot timeout even if saving fails" into rvc-dev am:...

Merge "Merge "Start screenshot timeout even if saving fails" into rvc-dev am: abbdec42 am: 463ea65a am: 73560bef" into rvc-qpr-dev-plus-aosp
parents 13cf433a 353aceb9
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -643,6 +643,18 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
     */
    private void showUiOnActionsReady(SavedImageData imageData) {
        logSuccessOnActionsReady(imageData);

        AccessibilityManager accessibilityManager = (AccessibilityManager)
                mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
        long timeoutMs = accessibilityManager.getRecommendedTimeoutMillis(
                SCREENSHOT_CORNER_DEFAULT_TIMEOUT_MILLIS,
                AccessibilityManager.FLAG_CONTENT_CONTROLS);

        mScreenshotHandler.removeMessages(MESSAGE_CORNER_TIMEOUT);
        mScreenshotHandler.sendMessageDelayed(
                mScreenshotHandler.obtainMessage(MESSAGE_CORNER_TIMEOUT),
                timeoutMs);

        if (imageData.uri != null) {
            mScreenshotHandler.post(() -> {
                if (mScreenshotAnimation != null && mScreenshotAnimation.isRunning()) {
@@ -656,17 +668,6 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
                } else {
                    createScreenshotActionsShadeAnimation(imageData).start();
                }

                AccessibilityManager accessibilityManager = (AccessibilityManager)
                        mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
                long timeoutMs = accessibilityManager.getRecommendedTimeoutMillis(
                        SCREENSHOT_CORNER_DEFAULT_TIMEOUT_MILLIS,
                        AccessibilityManager.FLAG_CONTENT_CONTROLS);

                mScreenshotHandler.removeMessages(MESSAGE_CORNER_TIMEOUT);
                mScreenshotHandler.sendMessageDelayed(
                        mScreenshotHandler.obtainMessage(MESSAGE_CORNER_TIMEOUT),
                        timeoutMs);
            });
        }
    }