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

Commit 9b43ce0c authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

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.

Bug: 25823676
Change-Id: I85fb98b43436930a2513274dc5ab408f7d41d97f
parent 0fe13b1f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2167,7 +2167,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) {