public static final class CalendarContract.CalendarAlerts extends Object implements BaseColumns, CalendarContract.CalendarAlertsColumns, CalendarContract.EventsColumns, CalendarContract.CalendarColumns
CalendarContract.ACTION_EVENT_REMINDER
. Apps that
receive this action may update the CalendarContract.CalendarAlertsColumns.STATE
for the reminder when
they have finished handling it. Apps that have their notifications
disabled should not modify the table to ensure that they do not conflict
with another app that is generating a notification. In general, apps
should not need to write to this table directly except to update the
state of a reminder.Modifier and Type | Field and Description |
---|---|
static Uri |
CONTENT_URI
The Uri for querying calendar alert information
|
static Uri |
CONTENT_URI_BY_INSTANCE
This URI is for grouping the query results by event_id and begin
time.
|
static String |
TABLE_NAME |
_COUNT, _ID
ALARM_TIME, BEGIN, CREATION_TIME, DEFAULT_SORT_ORDER, END, EVENT_ID, MINUTES, NOTIFY_TIME, RECEIVED_TIME, STATE, STATE_DISMISSED, STATE_FIRED, STATE_SCHEDULED
ACCESS_CONFIDENTIAL, ACCESS_DEFAULT, ACCESS_LEVEL, ACCESS_PRIVATE, ACCESS_PUBLIC, ALL_DAY, AVAILABILITY, AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE, CALENDAR_ID, CAN_INVITE_OTHERS, CUSTOM_APP_PACKAGE, CUSTOM_APP_URI, DESCRIPTION, DISPLAY_COLOR, DTEND, DTSTART, DURATION, EVENT_COLOR, EVENT_COLOR_KEY, EVENT_END_TIMEZONE, EVENT_LOCATION, EVENT_TIMEZONE, EXDATE, EXRULE, GUESTS_CAN_INVITE_OTHERS, GUESTS_CAN_MODIFY, GUESTS_CAN_SEE_GUESTS, HAS_ALARM, HAS_ATTENDEE_DATA, HAS_EXTENDED_PROPERTIES, IS_ORGANIZER, LAST_DATE, LAST_SYNCED, ORGANIZER, ORIGINAL_ALL_DAY, ORIGINAL_ID, ORIGINAL_INSTANCE_TIME, ORIGINAL_SYNC_ID, RDATE, RRULE, SELF_ATTENDEE_STATUS, STATUS, STATUS_CANCELED, STATUS_CONFIRMED, STATUS_TENTATIVE, SYNC_DATA1, SYNC_DATA10, SYNC_DATA2, SYNC_DATA3, SYNC_DATA4, SYNC_DATA5, SYNC_DATA6, SYNC_DATA7, SYNC_DATA8, SYNC_DATA9, TITLE, UID_2445
ALLOWED_ATTENDEE_TYPES, ALLOWED_AVAILABILITY, ALLOWED_REMINDERS, CAL_ACCESS_CONTRIBUTOR, CAL_ACCESS_EDITOR, CAL_ACCESS_FREEBUSY, CAL_ACCESS_NONE, CAL_ACCESS_OVERRIDE, CAL_ACCESS_OWNER, CAL_ACCESS_READ, CAL_ACCESS_RESPOND, CAL_ACCESS_ROOT, CALENDAR_ACCESS_LEVEL, CALENDAR_COLOR, CALENDAR_COLOR_KEY, CALENDAR_DISPLAY_NAME, CALENDAR_TIME_ZONE, CAN_MODIFY_TIME_ZONE, CAN_ORGANIZER_RESPOND, IS_PRIMARY, MAX_REMINDERS, OWNER_ACCOUNT, SYNC_EVENTS, VISIBLE
Modifier and Type | Method and Description |
---|---|
static boolean |
alarmExists(ContentResolver cr,
long eventId,
long begin,
long alarmTime)
Searches for an entry in the CalendarAlerts table that matches the
given event id, begin time and alarm time.
|
static long |
findNextAlarmTime(ContentResolver cr,
long millis)
Finds the next alarm after (or equal to) the given time and returns
the time of that alarm or -1 if no such alarm exists.
|
static Uri |
insert(ContentResolver cr,
long eventId,
long begin,
long end,
long alarmTime,
int minutes)
Helper for inserting an alarm time associated with an event TODO move
to Provider
|
static void |
rescheduleMissedAlarms(ContentResolver cr,
Context context,
AlarmManager manager)
Searches the CalendarAlerts table for alarms that should have fired
but have not and then reschedules them.
|
static void |
scheduleAlarm(Context context,
AlarmManager manager,
long alarmTime)
Schedules an alarm intent with the system AlarmManager that will
notify listeners when a reminder should be fired.
|
public static final String TABLE_NAME
public static final Uri CONTENT_URI
public static final Uri CONTENT_URI_BY_INSTANCE
public static final Uri insert(ContentResolver cr, long eventId, long begin, long end, long alarmTime, int minutes)
public static final long findNextAlarmTime(ContentResolver cr, long millis)
cr
- the ContentResolvermillis
- the time in UTC millisecondspublic static final void rescheduleMissedAlarms(ContentResolver cr, Context context, AlarmManager manager)
cr
- the ContentResolvercontext
- the Contextmanager
- the AlarmManagerpublic static void scheduleAlarm(Context context, AlarmManager manager, long alarmTime)
CalendarContract.ACTION_EVENT_REMINDER
. TODO Move to providercontext
- A context for referencing system resourcesmanager
- The AlarmManager to use or nullalarmTime
- The time to fire the intent in UTC millis since
epochpublic static final boolean alarmExists(ContentResolver cr, long eventId, long begin, long alarmTime)
cr
- the ContentResolvereventId
- the event id to matchbegin
- the start time of the event in UTC millisalarmTime
- the alarm time of the event in UTC millis