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

Commit 7ef34c1d authored by Paul Sliwowski's avatar Paul Sliwowski Committed by Android (Google) Code Review
Browse files

Merge "Add in-memory cache to dismiss alerts that we haven't seen yet." into...

Merge "Add in-memory cache to dismiss alerts that we haven't seen yet." into ics-ub-calendar-eggplant
parents 658beccd 137031dd
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -216,6 +216,13 @@ public class AlertService extends Service {
                }
            }

            // If we dismissed a notification for a new event, then we need to sync the cache when
            // an ACTION_PROVIDER_CHANGED event has been sent. Unfortunately, the data provider
            // has a delay of CalendarProvider2.SYNC_UPDATE_BROADCAST_TIMEOUT_MILLIS (ie. 30 sec.)
            // until it notifies us that the sync adapter has finished.
            // TODO(psliwowski): Find a quicker way to be notified when the data provider has the
            // syncId for event.
            GlobalDismissManager.syncSenderDismissCache(this);
            updateAlertNotification(this);
        } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
            // The provider usually initiates this setting up of alarms on startup,
@@ -277,6 +284,8 @@ public class AlertService extends Service {
            return true;
        }

        // Sync CalendarAlerts with global dismiss cache before query it
        GlobalDismissManager.syncReceiverDismissCache(context);
        Cursor alertCursor = cr.query(CalendarAlerts.CONTENT_URI, ALERT_PROJECTION,
                (ACTIVE_ALERTS_SELECTION + currentTime), ACTIVE_ALERTS_SELECTION_ARGS,
                ACTIVE_ALERTS_SORT);
@@ -814,7 +823,7 @@ public class AlertService extends Service {
                    lowPriorityEvents.add(newInfo);
                }
            }
            // TODO(cwren) add beginTime/startTime
            // TODO(psliwowski): move this to account synchronization
            GlobalDismissManager.processEventIds(context, eventIds.keySet());
        } finally {
            if (alertCursor != null) {
+263 −100

File changed.

Preview size limit exceeded, changes collapsed.