Remove redundant setPendingIntentWhitelistDuration() calls.

Since all pending intents are stored on a Set in the Notication object,
there is no need to individually check for specific pending intents.

BUG: 29480440
Change-Id: I27a18bb535a9a4bb6cb4e76bdc189e6c315a684a
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 3c3da78..7682af8 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -762,14 +762,13 @@
     public Bundle extras = new Bundle();
 
     /**
-     * All pending intents in the notification extras (notification extras, actions extras,
-     * and remote input extras) as the system needs to be able to access them but touching
-     * the extras bundle in the system process is not safe because the bundle may contain
+     * All pending intents in the notification as the system needs to be able to access them but
+     * touching the extras bundle in the system process is not safe because the bundle may contain
      * custom parcelable objects.
      *
      * @hide
      */
-    public ArraySet<PendingIntent> extrasPendingIntents;
+    public ArraySet<PendingIntent> allPendingIntents;
 
     /**
      * {@link #extras} key: this is the title of the notification,
@@ -1569,7 +1568,7 @@
         // intents in extras are always written as the last entry.
         readFromParcelImpl(parcel);
         // Must be read last!
-        extrasPendingIntents = (ArraySet<PendingIntent>) parcel.readArraySet(null);
+        allPendingIntents = (ArraySet<PendingIntent>) parcel.readArraySet(null);
     }
 
     private void readFromParcelImpl(Parcel parcel)
@@ -1727,8 +1726,8 @@
             }
         }
 
-        if (!ArrayUtils.isEmpty(extrasPendingIntents)) {
-            that.extrasPendingIntents = new ArraySet<>(extrasPendingIntents);
+        if (!ArrayUtils.isEmpty(allPendingIntents)) {
+            that.allPendingIntents = new ArraySet<>(allPendingIntents);
         }
 
         if (this.actions != null) {
@@ -1854,15 +1853,15 @@
         // cannot look into the extras as there may be parcelables there that
         // the platform does not know how to handle. To go around that we have
         // an explicit list of the pending intents in the extras bundle.
-        final boolean collectPendingIntents = (extrasPendingIntents == null);
+        final boolean collectPendingIntents = (allPendingIntents == null);
         if (collectPendingIntents) {
             PendingIntent.setOnMarshaledListener(
                     (PendingIntent intent, Parcel out, int outFlags) -> {
                 if (parcel == out) {
-                    if (extrasPendingIntents == null) {
-                        extrasPendingIntents = new ArraySet<>();
+                    if (allPendingIntents == null) {
+                        allPendingIntents = new ArraySet<>();
                     }
-                    extrasPendingIntents.add(intent);
+                    allPendingIntents.add(intent);
                 }
             });
         }
@@ -1871,7 +1870,7 @@
             // want to intercept all pending events written to the pacel.
             writeToParcelImpl(parcel, flags);
             // Must be written last!
-            parcel.writeArraySet(extrasPendingIntents);
+            parcel.writeArraySet(allPendingIntents);
         } finally {
             if (collectPendingIntents) {
                 PendingIntent.setOnMarshaledListener(null);