From 30731e72195a3efd90a129c7ceead81fce09deb2 Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Thu, 27 Oct 2022 14:25:53 +0000 Subject: [PATCH] Close system dialogs before launching LongScreenshotsActivity In rare cases they may be blocking the shared element transition. Bug: 241048682 Test: Manual reproduction of bug (long screenshot of quick actions edit screen) Change-Id: I069c8fb55a17ac456c7ced795ab4a23856eb9cda --- .../android/systemui/screenshot/ScreenshotController.java | 8 ++++++-- .../com/android/systemui/screenshot/ScreenshotView.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java index 231e415f17c6b..f1f36628f67ab 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java @@ -728,10 +728,14 @@ public class ScreenshotController { mLongScreenshotHolder.setLongScreenshot(longScreenshot); mLongScreenshotHolder.setTransitionDestinationCallback( - (transitionDestination, onTransitionEnd) -> + (transitionDestination, onTransitionEnd) -> { mScreenshotView.startLongScreenshotTransition( transitionDestination, onTransitionEnd, - longScreenshot)); + longScreenshot); + // TODO: Do this via ActionIntentExecutor instead. + mContext.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); + } + ); final Intent intent = new Intent(mContext, LongScreenshotActivity.class); intent.setFlags( diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 26cbcbf5214fa..1efb7dcc23014 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -872,6 +872,7 @@ public class ScreenshotView extends FrameLayout implements void startLongScreenshotTransition(Rect destination, Runnable onTransitionEnd, ScrollCaptureController.LongScreenshot longScreenshot) { + mPendingSharedTransition = true; AnimatorSet animSet = new AnimatorSet(); ValueAnimator scrimAnim = ValueAnimator.ofFloat(0, 1);