Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44223a28 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Fix a missing synchronization to Notification"

parents 379f81b2 1d9b8054
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2576,19 +2576,23 @@ public class Notification implements Parcelable
            PendingIntent.setOnMarshaledListener(
                    (PendingIntent intent, Parcel out, int outFlags) -> {
                if (parcel == out) {
                    synchronized (this) {
                        if (allPendingIntents == null) {
                            allPendingIntents = new ArraySet<>();
                        }
                        allPendingIntents.add(intent);
                    }
                }
            });
        }
        try {
            // IMPORTANT: Add marshaling code in writeToParcelImpl as we
            // want to intercept all pending events written to the parcel.
            writeToParcelImpl(parcel, flags);
            synchronized (this) {
                // Must be written last!
                parcel.writeArraySet(allPendingIntents);
            }
        } finally {
            if (collectPendingIntents) {
                PendingIntent.setOnMarshaledListener(null);