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

Commit 6b212287 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Randy Pan
Browse files

DO NOT MERGE Don't crash when canceling alarms if a direct listener is present

If a direct listener alarm attempts to match a regular
PendingIntent alarm, it will attempt to fetch the binder of the
regular alarm's direct listener, which is null, and crash the
system with an NPE.

Cherry-picked from 9b43ce0c
Bug: 25823676
Change-Id: I85fb98b43436930a2513274dc5ab408f7d41d97f
parent 4aa47e58
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2164,7 +2164,7 @@ class AlarmManagerService extends SystemService {
        public boolean matches(PendingIntent pi, IAlarmListener rec) {
            return (operation != null)
                    ? operation.equals(pi)
                    : listener.asBinder().equals(rec.asBinder());
                    : rec != null && listener.asBinder().equals(rec.asBinder());
        }

        public boolean matches(String packageName) {