Merge "Merge \"Remove redundant setPendingIntentWhitelistDuration() calls.\" into nyc-dev am: c1374208e3" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b1400b142e
@@ -762,14 +762,13 @@ public class Notification implements Parcelable
|
||||
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,
|
||||
@@ -1593,7 +1592,7 @@ public class Notification implements Parcelable
|
||||
// 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)
|
||||
@@ -1751,8 +1750,8 @@ public class Notification implements Parcelable
|
||||
}
|
||||
}
|
||||
|
||||
if (!ArrayUtils.isEmpty(extrasPendingIntents)) {
|
||||
that.extrasPendingIntents = new ArraySet<>(extrasPendingIntents);
|
||||
if (!ArrayUtils.isEmpty(allPendingIntents)) {
|
||||
that.allPendingIntents = new ArraySet<>(allPendingIntents);
|
||||
}
|
||||
|
||||
if (this.actions != null) {
|
||||
@@ -1878,15 +1877,15 @@ public class Notification implements Parcelable
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1895,7 +1894,7 @@ public class Notification implements Parcelable
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user