Build 1.0_r1(from source)

android.provider
Class Calendar.CalendarAlerts

java.lang.Object
  extended by android.provider.Calendar.CalendarAlerts
All Implemented Interfaces:
BaseColumns, Calendar.CalendarAlertsColumns, Calendar.CalendarsColumns, Calendar.EventsColumns
Enclosing class:
Calendar

public static final class Calendar.CalendarAlerts
extends Object
implements BaseColumns, Calendar.CalendarAlertsColumns, Calendar.EventsColumns, Calendar.CalendarsColumns


Field Summary
static Uri CONTENT_URI
           
static Uri CONTENT_URI_BY_INSTANCE
          This URI is for grouping the query results by event_id and begin time.
static String TABLE_NAME
           
 
Fields inherited from interface android.provider.BaseColumns
_COUNT, _ID
 
Fields inherited from interface android.provider.Calendar.CalendarAlertsColumns
ALARM_TIME, BEGIN, DEFAULT_SORT_ORDER, DISMISSED, END, EVENT_ID, FIRED, MINUTES, SCHEDULED, STATE
 
Fields inherited from interface android.provider.Calendar.EventsColumns
ALL_DAY, CALENDAR_ID, COMMENTS_URI, DESCRIPTION, DTEND, DTSTART, DURATION, EVENT_LOCATION, EVENT_TIMEZONE, EXDATE, EXRULE, HAS_ALARM, HAS_EXTENDED_PROPERTIES, HTML_URI, LAST_DATE, ORIGINAL_EVENT, ORIGINAL_INSTANCE_TIME, RDATE, RRULE, SELF_ATTENDEE_STATUS, STATUS, STATUS_CANCELED, STATUS_CONFIRMED, STATUS_TENTATIVE, TITLE, TRANSPARENCY, TRANSPARENCY_OPAQUE, TRANSPARENCY_TRANSPARENT, VISIBILITY, VISIBILITY_CONFIDENTIAL, VISIBILITY_DEFAULT, VISIBILITY_PRIVATE, VISIBILITY_PUBLIC
 
Fields inherited from interface android.provider.Calendar.CalendarsColumns
ACCESS_LEVEL, COLOR, CONTRIBUTOR_ACCESS, EDITOR_ACCESS, FREEBUSY_ACCESS, NO_ACCESS, OVERRIDE_ACCESS, OWNER_ACCESS, READ_ACCESS, RESPOND_ACCESS, ROOT_ACCESS, SELECTED, SYNC_EVENTS, TIMEZONE
 
Constructor Summary
Calendar.CalendarAlerts()
           
 
Method Summary
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)
           
static Cursor query(ContentResolver cr, String[] projection, String selection, String[] selectionArgs)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_NAME

public static final String TABLE_NAME
See Also:
Constant Field Values

CONTENT_URI

public static final Uri CONTENT_URI

CONTENT_URI_BY_INSTANCE

public static final Uri CONTENT_URI_BY_INSTANCE
This URI is for grouping the query results by event_id and begin time. This will return one result per instance of an event. So events with multiple alarms will appear just once, but multiple instances of a repeating event will show up multiple times.

Constructor Detail

Calendar.CalendarAlerts

public Calendar.CalendarAlerts()
Method Detail

insert

public static final Uri insert(ContentResolver cr,
                               long eventId,
                               long begin,
                               long end,
                               long alarmTime,
                               int minutes)

query

public static final Cursor query(ContentResolver cr,
                                 String[] projection,
                                 String selection,
                                 String[] selectionArgs)

findNextAlarmTime

public static final 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.

Parameters:
cr - the ContentResolver
millis - the time in UTC milliseconds
Returns:
the next alarm time greater than or equal to "millis", or -1 if no such alarm exists.

rescheduleMissedAlarms

public static final 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. This method can be called at boot time to restore alarms that may have been lost due to a phone reboot.

Parameters:
cr - the ContentResolver
context - the Context
manager - the AlarmManager

alarmExists

public static final 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. If one is found then this alarm already exists and this method returns true.

Parameters:
cr - the ContentResolver
eventId - the event id to match
begin - the start time of the event in UTC millis
alarmTime - the alarm time of the event in UTC millis
Returns:
true if there is already an alarm for the given event with the same start time and alarm time.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature