From 92867ad67014cb7f585d4adab0282982357d22c6 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 9 Apr 2024 15:10:53 +0600 Subject: [PATCH] feat: Remove notification after the event ended. issue: https://gitlab.e.foundation/e/backlog/-/issues/6430 --- .../com/android/calendar/alerts/AlertService.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/android/calendar/alerts/AlertService.java b/app/src/main/java/com/android/calendar/alerts/AlertService.java index 5b639efe0..5008b950d 100644 --- a/app/src/main/java/com/android/calendar/alerts/AlertService.java +++ b/app/src/main/java/com/android/calendar/alerts/AlertService.java @@ -526,15 +526,13 @@ public class AlertService extends Service { int newState = -1; boolean newAlert = false; - // Uncomment for the behavior of clearing out alerts after the - // events ended. b/1880369 - // - // if (endTime < currentTime) { - // newState = CalendarAlerts.DISMISSED; - // } else + // clearing out alerts after the events ended. b/1880369 + if (endTime < currentTime) { + newState = CalendarAlerts.STATE_DISMISSED; + } // Remove declined events - boolean sendAlert = !declined; + boolean sendAlert = !declined && newState != CalendarAlerts.STATE_DISMISSED; // Check for experimental reminder settings. if (remindRespondedOnly) { // If the experimental setting is turned on, then only send @@ -922,7 +920,7 @@ public class AlertService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { - + Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; msg.obj = intent.getExtras(); -- GitLab