Fix NPE in GlobalScreenshot am: 771d8f8fbb

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

Change-Id: Iaf35195edfc0655e19b1dbe120009847e67a36f1
This commit is contained in:
Miranda Kephart
2020-09-09 13:41:27 +00:00
committed by Automerger Merge Worker

View File

@@ -566,7 +566,8 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
private void saveScreenshot(Bitmap screenshot, Consumer<Uri> finisher, Rect screenRect,
Insets screenInsets, boolean showFlash) {
if (mScreenshotLayout.isAttachedToWindow()) {
if (!mDismissAnimation.isRunning()) { // if we didn't already dismiss for another reason
// if we didn't already dismiss for another reason
if (mDismissAnimation == null || !mDismissAnimation.isRunning()) {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_REENTERED);
}
dismissScreenshot("new screenshot requested", true);