Instances
class Instances : BaseColumns, CalendarContract.EventsColumns, CalendarContract.CalendarColumns
Fields and helpers for interacting with Instances. An instance is a single occurrence of an event including time zone specific start and end days and minutes. The instances table is not writable and only provides a way to query event occurrences.
Summary
Constants |
static String |
The beginning time of the instance, in UTC milliseconds.
|
static String |
The ending time of the instance, in UTC milliseconds.
|
static String |
The Julian end day of the instance, relative to the local time zone.
|
static String |
The end minute of the instance measured from midnight in the local time zone.
|
static String |
The _id of the event for this instance.
|
static String |
The Julian start day of the instance, relative to the local time zone.
|
static String |
The start minute of the instance measured from midnight in the local time zone.
|
Inherited constants |
From class EventsColumns
Int |
ACCESS_CONFIDENTIAL
Confidential is not used by the app.
|
Int |
ACCESS_DEFAULT
Default access is controlled by the server and will be treated as public on the device.
|
String |
ACCESS_LEVEL
Defines how the event shows up for others when the calendar is shared. Column name.
Type: INTEGER (One of ACCESS_DEFAULT , ...)
|
Int |
ACCESS_PRIVATE
Private shares the event as a free/busy slot with no details.
|
Int |
ACCESS_PUBLIC
Public makes the contents visible to anyone with access to the calendar.
|
String |
ALL_DAY
Is the event all day (time zone independent). Column name.
Type: INTEGER (boolean)
|
String |
AVAILABILITY
If this event counts as busy time or is still free time that can be scheduled over. Column name.
Type: INTEGER (One of AVAILABILITY_BUSY , AVAILABILITY_FREE , AVAILABILITY_TENTATIVE )
|
Int |
AVAILABILITY_BUSY
Indicates that this event takes up time and will conflict with other events.
|
Int |
AVAILABILITY_FREE
Indicates that this event is free time and will not conflict with other events.
|
Int |
AVAILABILITY_TENTATIVE
Indicates that the owner's availability may change, but should be considered busy time that will conflict.
|
String |
CALENDAR_ID
The Calendars#_ID of the calendar the event belongs to. Column name.
Type: INTEGER
|
String |
CAN_INVITE_OTHERS
Whether the user can invite others to the event. The GUESTS_CAN_INVITE_OTHERS is a setting that applies to an arbitrary guest, while CAN_INVITE_OTHERS indicates if the user can invite others (either through GUESTS_CAN_INVITE_OTHERS or because the user has modify access to the event). Column name.
Type: INTEGER (boolean, readonly)
|
String |
CUSTOM_APP_PACKAGE
The package name of the custom app that can provide a richer experience for the event. See the ACTION TYPE CalendarContract#ACTION_HANDLE_CUSTOM_EVENT for details. Column name.
Type: TEXT
|
String |
CUSTOM_APP_URI
The URI used by the custom app for the event. Column name.
Type: TEXT
|
String |
DESCRIPTION
The description of the event. Column name.
Type: TEXT
|
String |
DISPLAY_COLOR
This will be EVENT_COLOR if it is not null; otherwise, this will be Calendars#CALENDAR_COLOR . Read-only value. To modify, write to EVENT_COLOR or Calendars#CALENDAR_COLOR directly.
Type: INTEGER
|
String |
DTEND
The time the event ends in UTC millis since epoch. Column name.
Type: INTEGER (long; millis since epoch)
|
String |
DTSTART
The time the event starts in UTC millis since epoch. Column name.
Type: INTEGER (long; millis since epoch)
|
String |
DURATION
The duration of the event in RFC2445 format. Column name.
Type: TEXT (duration in RFC2445 format)
|
String |
EVENT_COLOR
A secondary color for the individual event. This should only be updated by the sync adapter for a given account.
Type: INTEGER
|
String |
EVENT_COLOR_KEY
A secondary color key for the individual event. NULL or an empty string are reserved for indicating that the event does not use a key for looking up the color. The provider will update EVENT_COLOR automatically when a valid key is written to this column. The key must reference an existing row of the Colors table. @see Colors
Type: TEXT
|
String |
EVENT_END_TIMEZONE
The timezone for the end time of the event. Column name.
Type: TEXT
|
String |
EVENT_LOCATION
Where the event takes place. Column name.
Type: TEXT
|
String |
EVENT_TIMEZONE
The timezone for the event. Column name.
Type: TEXT
|
String |
EXDATE
The recurrence exception dates for the event. Column name.
Type: TEXT
|
String |
EXRULE
The recurrence exception rule for the event. Column name.
Type: TEXT
|
String |
GUESTS_CAN_INVITE_OTHERS
Whether guests can invite other guests. Column name.
Type: INTEGER (boolean)
|
String |
GUESTS_CAN_MODIFY
Whether guests can modify the event. Column name.
Type: INTEGER (boolean)
|
String |
GUESTS_CAN_SEE_GUESTS
Whether guests can see the list of attendees. Column name.
Type: INTEGER (boolean)
|
String |
HAS_ALARM
Whether the event has an alarm or not. Column name.
Type: INTEGER (boolean)
|
String |
HAS_ATTENDEE_DATA
Whether the event has attendee information. True if the event has full attendee data, false if the event has information about self only. Column name.
Type: INTEGER (boolean)
|
String |
HAS_EXTENDED_PROPERTIES
Whether the event has extended properties or not. Column name.
Type: INTEGER (boolean)
|
String |
IS_ORGANIZER
Are we the organizer of this event. If this column is not explicitly set, the provider will return 1 if ORGANIZER is equal to Calendars#OWNER_ACCOUNT . Column name.
Type: STRING
|
String |
LAST_DATE
The last date this event repeats on, or NULL if it never ends. Column name.
Type: INTEGER (long; millis since epoch)
|
String |
LAST_SYNCED
Used to indicate that a row is not a real event but an original copy of a locally modified event. A copy is made when an event changes from non-dirty to dirty and the event is on a calendar with Calendars#CAN_PARTIALLY_UPDATE set to 1. This copy does not get expanded in the instances table and is only visible in queries made by a sync adapter. The copy gets removed when the event is changed back to non-dirty by a sync adapter.
Type: INTEGER (boolean)
|
String |
ORGANIZER
Email of the organizer (owner) of the event. Column name.
Type: STRING
|
String |
ORIGINAL_ALL_DAY
The allDay status (true or false) of the original recurring event for which this event is an exception. Column name.
Type: INTEGER (boolean)
|
String |
ORIGINAL_ID
The Events#_ID of the original recurring event for which this event is an exception. Column name.
Type: TEXT
|
String |
ORIGINAL_INSTANCE_TIME
The original instance time of the recurring event for which this event is an exception. Column name.
Type: INTEGER (long; millis since epoch)
|
String |
ORIGINAL_SYNC_ID
The _sync_id of the original recurring event for which this event is an exception. The provider should keep the original_id in sync when this is updated. Column name.
Type: TEXT
|
String |
RDATE
The recurrence dates for the event. Column name.
Type: TEXT
|
String |
RRULE
The recurrence rule for the event. Column name.
Type: TEXT
|
String |
SELF_ATTENDEE_STATUS
This is a copy of the attendee status for the owner of this event. This field is copied here so that we can efficiently filter out events that are declined without having to look in the Attendees table. Column name.
Type: INTEGER (int)
|
String |
STATUS
The event status. Column name.
Type: INTEGER (one of STATUS_TENTATIVE ...)
|
Int |
STATUS_CANCELED
|
Int |
STATUS_CONFIRMED
|
Int |
STATUS_TENTATIVE
|
String |
SYNC_DATA1
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA10
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA2
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA3
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA4
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA5
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA6
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA7
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA8
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
SYNC_DATA9
This column is available for use by sync adapters. Column name.
Type: TEXT
|
String |
TITLE
The title of the event. Column name.
Type: TEXT
|
String |
UID_2445
The UID for events added from the RFC 2445 iCalendar format. Column name.
Type: TEXT
|
|
From class CalendarColumns
String |
ALLOWED_ATTENDEE_TYPES
A comma separated list of attendee types supported for this calendar in the format "#,#,#". Valid types are Attendees#TYPE_NONE , Attendees#TYPE_OPTIONAL , Attendees#TYPE_REQUIRED , Attendees#TYPE_RESOURCE . Setting this field to only Attendees#TYPE_NONE should be used to indicate that changing the attendee type is not supported.
|
String |
ALLOWED_AVAILABILITY
A comma separated list of availability types supported for this calendar in the format "#,#,#". Valid types are Events#AVAILABILITY_BUSY , Events#AVAILABILITY_FREE , Events#AVAILABILITY_TENTATIVE . Setting this field to only Events#AVAILABILITY_BUSY should be used to indicate that changing the availability is not supported.
|
String |
ALLOWED_REMINDERS
A comma separated list of reminder methods supported for this calendar in the format "#,#,#". Valid types are Reminders#METHOD_DEFAULT , Reminders#METHOD_ALERT , Reminders#METHOD_EMAIL , Reminders#METHOD_SMS , Reminders#METHOD_ALARM . Column name.
Type: TEXT
|
String |
CALENDAR_ACCESS_LEVEL
The level of access that the user has for the calendar
Type: INTEGER (one of the values below)
|
String |
CALENDAR_COLOR
The color of the calendar. This should only be updated by the sync adapter, not other apps, as changing a calendar's color can adversely affect its display.
Type: INTEGER (color value)
|
String |
CALENDAR_COLOR_KEY
A key for looking up a color from the Colors table. NULL or an empty string are reserved for indicating that the calendar does not use a key for looking up the color. The provider will update CALENDAR_COLOR automatically when a valid key is written to this column. The key must reference an existing row of the Colors table. @see Colors
Type: TEXT
|
String |
CALENDAR_DISPLAY_NAME
The display name of the calendar. Column name.
Type: TEXT
|
String |
CALENDAR_TIME_ZONE
The time zone the calendar is associated with.
Type: TEXT
|
Int |
CAL_ACCESS_CONTRIBUTOR
Full access to modify the calendar, but not the access control settings
|
Int |
CAL_ACCESS_EDITOR
Full access to modify the calendar, but not the access control settings
|
Int |
CAL_ACCESS_FREEBUSY
Can only see free/busy information about the calendar
|
Int |
CAL_ACCESS_NONE
Cannot access the calendar
|
Int |
CAL_ACCESS_OVERRIDE
not used
|
Int |
CAL_ACCESS_OWNER
Full access to the calendar
|
Int |
CAL_ACCESS_READ
Can read all event details
|
Int |
CAL_ACCESS_RESPOND
Can reply yes/no/maybe to an event
|
Int |
CAL_ACCESS_ROOT
Domain admin
|
String |
CAN_MODIFY_TIME_ZONE
Can the organizer modify the time zone of the event? Column name.
Type: INTEGER (boolean)
|
String |
CAN_ORGANIZER_RESPOND
Can the organizer respond to the event? If no, the status of the organizer should not be shown by the UI. Defaults to 1. Column name.
Type: INTEGER (boolean)
|
String |
IS_PRIMARY
Is this the primary calendar for this account. If this column is not explicitly set, the provider will return 1 if Calendars#ACCOUNT_NAME is equal to Calendars#OWNER_ACCOUNT .
|
String |
MAX_REMINDERS
The maximum number of reminders allowed for an event. Column name.
Type: INTEGER
|
String |
OWNER_ACCOUNT
The owner account for this calendar, based on the calendar feed. This will be different from the _SYNC_ACCOUNT for delegated calendars. Column name.
Type: String
|
String |
SYNC_EVENTS
Is this calendar synced and are its events stored on the device? 0 - Do not sync this calendar or store events for this calendar. 1 - Sync down events for this calendar.
Type: INTEGER (boolean)
|
String |
VISIBLE
Is the calendar selected to be displayed? 0 - do not show events associated with this calendar. 1 - show events associated with this calendar
Type: INTEGER (boolean)
|
|
|
Public methods |
static Cursor! |
Performs a query to return all visible instances in the given range.
|
static Cursor! |
Performs a query to return all visible instances in the given range that match the given query.
|
Properties |
static Uri! |
The content:// style URL for querying an instance range by Julian Day.
|
static Uri! |
The content:// style URL for querying an instance range with a search term.
|
static Uri! |
The content:// style URL for querying an instance range with a search term.
|
static Uri! |
The content:// style URL for querying an instance range.
|
static Uri |
The content:// style URL for querying an instance range by Julian Day in the managed profile.
|
static Uri |
The content:// style URL for querying an instance range with a search term in the managed profile.
|
static Uri |
The content:// style URL for querying an instance range with a search term in the managed profile.
|
static Uri |
The content:// style URL for querying an instance range in the managed profile.
|
Constants
BEGIN
static val BEGIN: String
The beginning time of the instance, in UTC milliseconds. Column name.
Type: INTEGER (long; millis since epoch)
Value: "begin"
END
static val END: String
The ending time of the instance, in UTC milliseconds. Column name.
Type: INTEGER (long; millis since epoch)
Value: "end"
END_DAY
static val END_DAY: String
The Julian end day of the instance, relative to the local time zone. Column name.
Type: INTEGER (int)
Value: "endDay"
END_MINUTE
static val END_MINUTE: String
The end minute of the instance measured from midnight in the local time zone. Column name.
Type: INTEGER (int)
Value: "endMinute"
EVENT_ID
static val EVENT_ID: String
The _id of the event for this instance. Column name.
Type: INTEGER (long, foreign key to the Events table)
Value: "event_id"
START_DAY
static val START_DAY: String
The Julian start day of the instance, relative to the local time zone. Column name.
Type: INTEGER (int)
Value: "startDay"
START_MINUTE
static val START_MINUTE: String
The start minute of the instance measured from midnight in the local time zone. Column name.
Type: INTEGER (int)
Value: "startMinute"
Public methods
query
static fun query(
cr: ContentResolver!,
projection: Array<String!>!,
begin: Long,
end: Long
): Cursor!
Performs a query to return all visible instances in the given range. This is a blocking function and should not be done on the UI thread. This will cause an expansion of recurring events to fill this time range if they are not already expanded and will slow down for larger time ranges with many recurring events.
Parameters |
cr |
ContentResolver!: The ContentResolver to use for the query |
projection |
Array<String!>!: The columns to return |
begin |
Long: The start of the time range to query in UTC millis since epoch |
end |
Long: The end of the time range to query in UTC millis since epoch |
Return |
Cursor! |
A Cursor containing all instances in the given range |
query
static fun query(
cr: ContentResolver!,
projection: Array<String!>!,
begin: Long,
end: Long,
searchQuery: String!
): Cursor!
Performs a query to return all visible instances in the given range that match the given query. This is a blocking function and should not be done on the UI thread. This will cause an expansion of recurring events to fill this time range if they are not already expanded and will slow down for larger time ranges with many recurring events.
Parameters |
cr |
ContentResolver!: The ContentResolver to use for the query |
projection |
Array<String!>!: The columns to return |
begin |
Long: The start of the time range to query in UTC millis since epoch |
end |
Long: The end of the time range to query in UTC millis since epoch |
searchQuery |
String!: A string of space separated search terms. Segments enclosed by double quotes will be treated as a single term. |
Return |
Cursor! |
A Cursor of instances matching the search terms in the given time range |
Properties
CONTENT_BY_DAY_URI
static val CONTENT_BY_DAY_URI: Uri!
The content:// style URL for querying an instance range by Julian Day. The start and end day should be added as path segments if this is used directly.
CONTENT_SEARCH_BY_DAY_URI
static val CONTENT_SEARCH_BY_DAY_URI: Uri!
The content:// style URL for querying an instance range with a search term. The start day, end day, and search string should be appended as path segments if this is used directly.
CONTENT_SEARCH_URI
static val CONTENT_SEARCH_URI: Uri!
The content:// style URL for querying an instance range with a search term. The begin, end, and search string should be appended as path segments if this is used directly.
CONTENT_URI
static val CONTENT_URI: Uri!
The content:// style URL for querying an instance range. The begin and end of the range to query should be added as path segments if this is used directly.
ENTERPRISE_CONTENT_BY_DAY_URI
static val ENTERPRISE_CONTENT_BY_DAY_URI: Uri
The content:// style URL for querying an instance range by Julian Day in the managed profile. It supports similar semantics as CONTENT_BY_DAY_URI
and performs similar checks as ENTERPRISE_CONTENT_URI
.
ENTERPRISE_CONTENT_SEARCH_BY_DAY_URI
static val ENTERPRISE_CONTENT_SEARCH_BY_DAY_URI: Uri
The content:// style URL for querying an instance range with a search term in the managed profile. It supports similar semantics as CONTENT_SEARCH_BY_DAY_URI
and performs similar checks as ENTERPRISE_CONTENT_URI
.
ENTERPRISE_CONTENT_SEARCH_URI
static val ENTERPRISE_CONTENT_SEARCH_URI: Uri
The content:// style URL for querying an instance range with a search term in the managed profile. It supports similar semantics as CONTENT_SEARCH_URI
and performs similar checks as ENTERPRISE_CONTENT_URI
.
ENTERPRISE_CONTENT_URI
static val ENTERPRISE_CONTENT_URI: Uri
The content:// style URL for querying an instance range in the managed profile. It supports similar semantics as CONTENT_URI
.
The following columns plus the columns that are allowed by Events#ENTERPRISE_CONTENT_URI
are allowed to be queried via this uri:
IllegalArgumentException
is thrown if there exists columns in the projection of the query to this uri that are not contained in the above list.
This uri returns an empty cursor if the calling user is not a parent profile of a managed profile, or the managed profile is disabled, or cross-profile calendar is disabled in Settings, or this uri is queried from a package that is not allowed by the profile owner of the managed profile via DevicePolicyManager#setCrossProfileCalendarPackages(ComponentName, Set)
.