diff options
| author | Suprabh Shukla <suprabh@google.com> | 2019-10-30 18:56:44 -0700 |
|---|---|---|
| committer | Suprabh Shukla <suprabh@google.com> | 2019-11-04 11:59:36 -0800 |
| commit | 0d51a8bcc0d5ac6dadbf242db5ce9404ca369fb2 (patch) | |
| tree | 4a2229030a853f72f12eb172a62186f78c32504f /core/java/android | |
| parent | c4f77faf6e2ac5ef42ed95371cb2ef16030a2b02 (diff) | |
Remove cancel listeners from pending intent alarms
The cancel listeners are created per PendingIntent instance and were
spamming the callback list stored inside PendingIntentRecord. In cases
where there is even a single live PendingIntent backed by this
PendingIntentRecord, all PendingIntent instances backed by this
PendingIntentRecord for which a callback was ever registered will leak.
Test: atest FrameworksMockingServicesTests:\
com.android.server.am.PendingIntentControllerTest
atest FrameworksMockingServicesTests:\
com.android.server.AlarmManagerServiceTest
Bug: 143091024
Change-Id: I65df12da0c437064e6e3719911926738c677c4eb
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/PendingIntent.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index 4b4a071ecf72..a9cbfcead5c7 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -1268,7 +1268,12 @@ public final class PendingIntent implements Parcelable { return b != null ? new PendingIntent(b, in.getClassCookie(PendingIntent.class)) : null; } - /*package*/ PendingIntent(IIntentSender target) { + /** + * Creates a PendingIntent with the given target. + * @param target the backing IIntentSender + * @hide + */ + public PendingIntent(IIntentSender target) { mTarget = target; } |
