Merge "Restore non-scrolling UI on long screenshots crash" into sc-dev am: 7ab8dd98ba

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

Change-Id: I3f838425d78c965f09f91dc557e3531bd47e3c4d
This commit is contained in:
Miranda Kephart
2021-07-01 20:24:48 +00:00
committed by Automerger Merge Worker
2 changed files with 24 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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());
}