/**@class android.provider.CalendarContract.Calendars implements android.provider.BaseColumns implements android.provider.CalendarContract.SyncColumns implements android.provider.CalendarContract.CalendarColumns @extends java.lang.Object Constants and helpers for the Calendars table, which contains details for individual calendars. <h3>Operations</h3> All operations can be done either as an app or as a sync adapter. To perform an operation as a sync adapter {@link #CALLER_IS_SYNCADAPTER} should be set to true and {@link #ACCOUNT_NAME} and {@link #ACCOUNT_TYPE} must be set in the Uri parameters. See {@link Uri.Builder#appendQueryParameter(java.lang.String, java.lang.String)} for details on adding parameters. Sync adapters have write access to more columns but are restricted to a single account at a time. Calendars are designed to be primarily managed by a sync adapter and inserting new calendars should be done as a sync adapter. For the most part, apps should only update calendars (such as changing the color or display name). If a local calendar is required an app can do so by inserting as a sync adapter and using an {@link #ACCOUNT_TYPE} of {@link #ACCOUNT_TYPE_LOCAL} . <dl> <dt><b>Insert</b></dt> <dd>When inserting a new calendar the following fields must be included: <ul> <li>{@link #ACCOUNT_NAME}</li> <li>{@link #ACCOUNT_TYPE}</li> <li>{@link #NAME}</li> <li>{@link #CALENDAR_DISPLAY_NAME}</li> <li>{@link #CALENDAR_COLOR}</li> <li>{@link #CALENDAR_ACCESS_LEVEL}</li> <li>{@link #OWNER_ACCOUNT}</li> </ul> The following fields are not required when inserting a Calendar but are generally a good idea to include: <ul> <li>{@link #SYNC_EVENTS} set to 1</li> <li>{@link #CALENDAR_TIME_ZONE}</li> <li>{@link #ALLOWED_REMINDERS}</li> <li>{@link #ALLOWED_AVAILABILITY}</li> <li>{@link #ALLOWED_ATTENDEE_TYPES}</li> </ul> <dt><b>Update</b></dt> <dd>To perform an update on a calendar the {@link #_ID} of the calendar should be provided either as an appended id to the Uri ( {@link ContentUris#withAppendedId}) or as the first selection item--the selection should start with "_id=?" and the first selectionArg should be the _id of the calendar. Calendars may also be updated using a selection without the id. In general, the {@link #ACCOUNT_NAME} and {@link #ACCOUNT_TYPE} should not be changed after a calendar is created as this can cause issues for sync adapters. <dt><b>Delete</b></dt> <dd>Calendars can be deleted either by the {@link #_ID} as an appended id on the Uri or using any standard selection. Deleting a calendar should generally be handled by a sync adapter as it will remove the calendar from the database and all associated data (aka events).</dd> <dt><b>Query</b></dt> <dd>Querying the Calendars table will get you all information about a set of calendars. There will be one row returned for each calendar that matches the query selection, or at most a single row if the {@link #_ID} is appended to the Uri.</dd> </dl> <h3>Calendar Columns</h3> The following Calendar columns are writable by both an app and a sync adapter. <ul> <li>{@link #NAME}</li> <li>{@link #CALENDAR_DISPLAY_NAME}</li> <li>{@link #VISIBLE}</li> <li>{@link #SYNC_EVENTS}</li> </ul> The following Calendars columns are writable only by a sync adapter <ul> <li>{@link #ACCOUNT_NAME}</li> <li>{@link #ACCOUNT_TYPE}</li> <li>{@link #CALENDAR_COLOR}</li> <li>{@link #_SYNC_ID}</li> <li>{@link #DIRTY}</li> <li>{@link #MUTATORS}</li> <li>{@link #OWNER_ACCOUNT}</li> <li>{@link #MAX_REMINDERS}</li> <li>{@link #ALLOWED_REMINDERS}</li> <li>{@link #ALLOWED_AVAILABILITY}</li> <li>{@link #ALLOWED_ATTENDEE_TYPES}</li> <li>{@link #CAN_MODIFY_TIME_ZONE}</li> <li>{@link #CAN_ORGANIZER_RESPOND}</li> <li>{@link #CAN_PARTIALLY_UPDATE}</li> <li>{@link #CALENDAR_LOCATION}</li> <li>{@link #CALENDAR_TIME_ZONE}</li> <li>{@link #CALENDAR_ACCESS_LEVEL}</li> <li>{@link #DELETED}</li> <li>{@link #CAL_SYNC1}</li> <li>{@link #CAL_SYNC2}</li> <li>{@link #CAL_SYNC3}</li> <li>{@link #CAL_SYNC4}</li> <li>{@link #CAL_SYNC5}</li> <li>{@link #CAL_SYNC6}</li> <li>{@link #CAL_SYNC7}</li> <li>{@link #CAL_SYNC8}</li> <li>{@link #CAL_SYNC9}</li> <li>{@link #CAL_SYNC10}</li> </ul> */ var Calendars = { /** The content:// style URL for accessing Calendars */ CONTENT_URI : "null", /** The content:// style URL for querying Calendars table in the managed profile. Appending a calendar id using {@link ContentUris#withAppendedId(Uri, long)} specifies a single calendar. <p>The following columns are allowed to be queried via this uri: <ul> <li>{@link #_ID}</li> <li>{@link #CALENDAR_COLOR}</li> <li>{@link #VISIBLE}</li> <li>{@link #CALENDAR_LOCATION}</li> <li>{@link #CALENDAR_TIME_ZONE}</li> <li>{@link #IS_PRIMARY}</li> </ul> <p>{@link IllegalArgumentException} is thrown if there exists columns in the projection of the query to this uri that are not contained in the above list. <p>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 {@link DevicePolicyManager#setCrossProfileCalendarPackages(ComponentName, Set)}. <p>Apps can register a {@link android.database.ContentObserver} for this URI to listen to changes. @see DevicePolicyManager#getCrossProfileCalendarPackages(ComponentName) @see Settings.Secure#CROSS_PROFILE_CALENDAR_ENABLED */ ENTERPRISE_CONTENT_URI : "null", /** The default sort order for this table */ DEFAULT_SORT_ORDER : "calendar_displayName", /** The name of the calendar. Column name. <P>Type: TEXT</P> */ NAME : "name", /** The default location for the calendar. Column name. <P>Type: TEXT</P> */ CALENDAR_LOCATION : "calendar_location", /** These fields are only writable by a sync adapter. To modify them the caller must include {@link #CALLER_IS_SYNCADAPTER}, {@link #ACCOUNT_NAME}, and {@link #ACCOUNT_TYPE} in the Uri's query parameters. TODO move to provider @hide */ SYNC_WRITABLE_COLUMNS : "null", };