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 5b639efe09717998dd373c4a98c8994b0f9ce686..5008b950df1f5e12abd152dee59c3ab0d819718a 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();