diff options
| author | 2022-11-30 17:48:03 +0000 | |
|---|---|---|
| committer | 2022-11-30 17:48:03 +0000 | |
| commit | 81a1b8bb8550328cd0fea731ad94c883e7b5786c (patch) | |
| tree | 72a59416f4514aeac8d2a2db5c2ba17e0bcdd628 | |
| parent | 6aeb8d9a449bd985b25cef96ba8a18135132e52b (diff) | |
| parent | c9bc669d43a5c7913bbdc24129e18b799cd342bd (diff) | |
Merge "Add null check for quick share intent" into tm-qpr-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 7641554ede3d..fae938d542f1 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -825,12 +825,23 @@ public class ScreenshotView extends FrameLayout implements } }); if (mQuickShareChip != null) { - mQuickShareChip.setPendingIntent(imageData.quickShareAction.actionIntent, - () -> { - mUiEventLogger.log( - ScreenshotEvent.SCREENSHOT_SMART_ACTION_TAPPED, 0, mPackageName); - animateDismissal(); - }); + if (imageData.quickShareAction != null) { + mQuickShareChip.setPendingIntent(imageData.quickShareAction.actionIntent, + () -> { + mUiEventLogger.log( + ScreenshotEvent.SCREENSHOT_SMART_ACTION_TAPPED, 0, + mPackageName); + animateDismissal(); + }); + } else { + // hide chip and unset pending interaction if necessary, since we don't actually + // have a useable quick share intent + Log.wtf(TAG, "Showed quick share chip, but quick share intent was null"); + if (mPendingInteraction == PendingInteraction.QUICK_SHARE) { + mPendingInteraction = null; + } + mQuickShareChip.setVisibility(GONE); + } } if (mPendingInteraction != null) { |