NotificationMgr.java revision 948c590ced6854d2fbe9dc765db4ae8d63646664
1package com.android.calendar.alerts;
2
3import com.android.calendar.alerts.AlertService.NotificationWrapper;
4
5public abstract class NotificationMgr {
6    public abstract void notify(int id, NotificationWrapper notification);
7    public abstract void cancel(int id);
8
9    /**
10     * Don't actually use the notification framework's cancelAll since the SyncAdapter
11     * might post notifications and we don't want to affect those.
12     */
13    public void cancelAll() {
14        cancelAllBetween(0, AlertService.MAX_NOTIFICATIONS);
15    }
16
17    /**
18     * Cancels IDs between the specified bounds, inclusively.
19     */
20    public void cancelAllBetween(int from, int to) {
21        for (int i = from; i <= to; i++) {
22            cancel(i);
23        }
24    }
25}
26