Update the 'is valid contentIntent' check

Existing check required that the original request code be 0,
but that's not actually required for the intent to work on this
page

Test: tap on email notification in history, be brought to email
page and not main email list page
Fixes: 232495202

Change-Id: I120022535ddbde19003f2db6f1b81a983d00789d
This commit is contained in:
Julia Reynolds
2022-05-13 13:22:06 -04:00
parent 9c3c55ecd0
commit 688c5c900d

View File

@@ -98,9 +98,7 @@ public class NotificationSbnViewHolder extends RecyclerView.ViewHolder {
boolean isSnoozed, UiEventLogger uiEventLogger) {
Intent appIntent = itemView.getContext().getPackageManager()
.getLaunchIntentForPackage(pkg);
boolean isPendingIntentValid = pi != null && PendingIntent.getActivity(
itemView.getContext(), 0, pi.getIntent(),
PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_NO_CREATE) != null;
boolean isPendingIntentValid = pi != null && pi.isActivity();
if (isPendingIntentValid || appIntent != null) {
itemView.setOnClickListener(v -> {
uiEventLogger.logWithInstanceIdAndPosition(