Merge "Add null check for quick share intent" into tm-qpr-dev am: 81a1b8bb85 am: 3e7d7e8b71

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

Change-Id: I66f92549613bd1e5e99456607fe32871bbef0e99
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Miranda Kephart
2022-12-02 02:23:14 +00:00
committed by Automerger Merge Worker

View File

@@ -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) {