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

Commit 3dd61f2d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Cancel NotificationTimeout alarms when canceling notification" am:...

Merge "Cancel NotificationTimeout alarms when canceling notification" am: 9e7ac57a am: c60c7a1a am: f82ddac1

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1695745

Change-Id: Ied244fadf461a1147e85fbd02bdf945672e5d6b8
parents 6c1ae930 f82ddac1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -8310,6 +8310,21 @@ public class NotificationManagerService extends SystemService {
            int rank, int count, boolean wasPosted, String listenerName) {
        final String canceledKey = r.getKey();

        // Get pending intent used to create alarm, use FLAG_NO_CREATE if PendingIntent
        // does not already exist, then null will be returned.
        final PendingIntent pi = PendingIntent.getBroadcast(getContext(),
                REQUEST_CODE_TIMEOUT,
                new Intent(ACTION_NOTIFICATION_TIMEOUT)
                        .setData(new Uri.Builder().scheme(SCHEME_TIMEOUT)
                                .appendPath(r.getKey()).build())
                        .addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
                PendingIntent.FLAG_NO_CREATE | PendingIntent.FLAG_IMMUTABLE);

        // Cancel alarm corresponding to pi.
        if (pi != null) {
            mAlarmManager.cancel(pi);
        }

        // Record caller.
        recordCallerLocked(r);