Fix NPE in GlobalScreenshot

Bug: 167655989
Fix: 167655989
Test: take screenshot, take another while first is still up,
observe that NPE occurs. add null check, repeat, verify that NPE
does not occur.

Change-Id: I1290f3a556aba5182e3f96ce524efb86364bc3e1
This commit is contained in:
Miranda Kephart
2020-09-03 16:13:01 -04:00
committed by Matt Casey
parent 71f959be7e
commit 771d8f8fbb

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);