Skip to content

Commit 4172d95

Browse files
committed
Add new Calendar APIs to fw
b/5317399 b/5309787 b/5207781 b/5347210 Adds apis for a color table to support future migrations. Adds allowedAttendeeTypes and allowedAvailabilities for exchange/gsync support. Adds type_resource for attendees and tentative availability. Documents that eventTimezone is required for creating an event. Change-Id: Id3f866c46f76f2b5b098f4961ea09d48f17598c3
1 parent 1bfe6e9 commit 4172d95

File tree

2 files changed

+46
-45
lines changed

2 files changed

+46
-45
lines changed

api/current.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15728,6 +15728,7 @@ package android.provider {
1572815728
field public static final int TYPE_NONE = 0; // 0x0
1572915729
field public static final int TYPE_OPTIONAL = 2; // 0x2
1573015730
field public static final int TYPE_REQUIRED = 1; // 0x1
15731+
field public static final int TYPE_RESOURCE = 3; // 0x3
1573115732
}
1573215733

1573315734
public static final class CalendarContract.CalendarAlerts implements android.provider.BaseColumns android.provider.CalendarContract.CalendarAlertsColumns android.provider.CalendarContract.CalendarColumns android.provider.CalendarContract.EventsColumns {
@@ -15766,9 +15767,12 @@ package android.provider {
1576615767
}
1576715768

1576815769
protected static abstract interface CalendarContract.CalendarColumns {
15770+
field public static final java.lang.String ALLOWED_ATTENDEE_TYPES = "allowedAttendeeTypes";
15771+
field public static final java.lang.String ALLOWED_AVAILABILITY = "allowedAvailability";
1576915772
field public static final java.lang.String ALLOWED_REMINDERS = "allowedReminders";
1577015773
field public static final java.lang.String CALENDAR_ACCESS_LEVEL = "calendar_access_level";
1577115774
field public static final java.lang.String CALENDAR_COLOR = "calendar_color";
15775+
field public static final java.lang.String CALENDAR_COLOR_KEY = "calendar_color_index";
1577215776
field public static final java.lang.String CALENDAR_DISPLAY_NAME = "calendar_displayName";
1577315777
field public static final java.lang.String CALENDAR_TIME_ZONE = "calendar_timezone";
1577415778
field public static final int CAL_ACCESS_CONTRIBUTOR = 500; // 0x1f4
@@ -15813,6 +15817,18 @@ package android.provider {
1581315817
field public static final java.lang.String NAME = "name";
1581415818
}
1581515819

15820+
public static final class CalendarContract.Colors implements android.provider.CalendarContract.ColorsColumns {
15821+
field public static final android.net.Uri CONTENT_URI;
15822+
}
15823+
15824+
protected static abstract interface CalendarContract.ColorsColumns implements android.provider.SyncStateContract.Columns {
15825+
field public static final java.lang.String COLOR = "color";
15826+
field public static final java.lang.String COLOR_KEY = "color_index";
15827+
field public static final java.lang.String COLOR_TYPE = "color_type";
15828+
field public static final int TYPE_CALENDAR = 0; // 0x0
15829+
field public static final int TYPE_EVENT = 1; // 0x1
15830+
}
15831+
1581615832
public static final class CalendarContract.EventDays implements android.provider.CalendarContract.EventDaysColumns {
1581715833
method public static final android.database.Cursor query(android.content.ContentResolver, int, int, java.lang.String[]);
1581815834
field public static final android.net.Uri CONTENT_URI;
@@ -15838,13 +15854,15 @@ package android.provider {
1583815854
field public static final java.lang.String AVAILABILITY = "availability";
1583915855
field public static final int AVAILABILITY_BUSY = 0; // 0x0
1584015856
field public static final int AVAILABILITY_FREE = 1; // 0x1
15857+
field public static final int AVAILABILITY_TENTATIVE = 2; // 0x2
1584115858
field public static final java.lang.String CALENDAR_ID = "calendar_id";
1584215859
field public static final java.lang.String CAN_INVITE_OTHERS = "canInviteOthers";
1584315860
field public static final java.lang.String DESCRIPTION = "description";
1584415861
field public static final java.lang.String DTEND = "dtend";
1584515862
field public static final java.lang.String DTSTART = "dtstart";
1584615863
field public static final java.lang.String DURATION = "duration";
1584715864
field public static final java.lang.String EVENT_COLOR = "eventColor";
15865+
field public static final java.lang.String EVENT_COLOR_KEY = "eventColor_index";
1584815866
field public static final java.lang.String EVENT_END_TIMEZONE = "eventEndTimezone";
1584915867
field public static final java.lang.String EVENT_LOCATION = "eventLocation";
1585015868
field public static final java.lang.String EVENT_TIMEZONE = "eventTimezone";

core/java/android/provider/CalendarContract.java

Lines changed: 28 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,17 @@ protected interface CalendarColumns {
300300
public static final String CALENDAR_COLOR = "calendar_color";
301301

302302
/**
303-
* An index for looking up a color from the {@link Colors} table. NULL
304-
* or an empty string are reserved for indicating that the calendar does
305-
* not use an index for looking up the color. The provider will update
306-
* {@link #CALENDAR_COLOR} automatically when a valid index is written
307-
* to this column. The index must reference an existing row of the
303+
* A key for looking up a color from the {@link Colors} table. NULL or
304+
* an empty string are reserved for indicating that the calendar does
305+
* not use a key for looking up the color. The provider will update
306+
* {@link #CALENDAR_COLOR} automatically when a valid key is written to
307+
* this column. The key must reference an existing row of the
308308
* {@link Colors} table. @see Colors
309309
* <P>
310310
* Type: TEXT
311311
* </P>
312-
* TODO UNHIDE
313-
*
314-
* @hide
315312
*/
316-
public static final String CALENDAR_COLOR_INDEX = "calendar_color_index";
313+
public static final String CALENDAR_COLOR_KEY = "calendar_color_index";
317314

318315
/**
319316
* The display name of the calendar. Column name.
@@ -419,9 +416,6 @@ protected interface CalendarColumns {
419416
* {@link Events#AVAILABILITY_BUSY} should be used to indicate that
420417
* changing the availability is not supported.
421418
*
422-
* TODO UNHIDE, Update Calendars doc
423-
*
424-
* @hide
425419
*/
426420
public static final String ALLOWED_AVAILABILITY = "allowedAvailability";
427421

@@ -433,9 +427,6 @@ protected interface CalendarColumns {
433427
* {@link Attendees#TYPE_NONE} should be used to indicate that changing
434428
* the attendee type is not supported.
435429
*
436-
* TODO UNHIDE, Update Calendars doc
437-
*
438-
* @hide
439430
*/
440431
public static final String ALLOWED_ATTENDEE_TYPES = "allowedAttendeeTypes";
441432
}
@@ -573,6 +564,8 @@ public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException
573564
* <li>{@link #SYNC_EVENTS} set to 1</li>
574565
* <li>{@link #CALENDAR_TIME_ZONE}</li>
575566
* <li>{@link #ALLOWED_REMINDERS}</li>
567+
* <li>{@link #ALLOWED_AVAILABILITY}</li>
568+
* <li>{@link #ALLOWED_ATTENDEE_TYPES}</li>
576569
* </ul>
577570
* <dt><b>Update</b></dt>
578571
* <dd>To perform an update on a calendar the {@link #_ID} of the calendar
@@ -612,6 +605,8 @@ public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException
612605
* <li>{@link #OWNER_ACCOUNT}</li>
613606
* <li>{@link #MAX_REMINDERS}</li>
614607
* <li>{@link #ALLOWED_REMINDERS}</li>
608+
* <li>{@link #ALLOWED_AVAILABILITY}</li>
609+
* <li>{@link #ALLOWED_ATTENDEE_TYPES}</li>
615610
* <li>{@link #CAN_MODIFY_TIME_ZONE}</li>
616611
* <li>{@link #CAN_ORGANIZER_RESPOND}</li>
617612
* <li>{@link #CAN_PARTIALLY_UPDATE}</li>
@@ -735,7 +730,8 @@ protected interface AttendeesColumns {
735730
/**
736731
* The type of attendee. Column name.
737732
* <P>
738-
* Type: Integer (one of {@link #TYPE_REQUIRED}, {@link #TYPE_OPTIONAL}
733+
* Type: Integer (one of {@link #TYPE_NONE}, {@link #TYPE_REQUIRED},
734+
* {@link #TYPE_OPTIONAL}, {@link #TYPE_RESOURCE})
739735
* </P>
740736
*/
741737
public static final String ATTENDEE_TYPE = "attendeeType";
@@ -744,10 +740,8 @@ protected interface AttendeesColumns {
744740
public static final int TYPE_REQUIRED = 1;
745741
public static final int TYPE_OPTIONAL = 2;
746742
/**
747-
* This specifies that an attendee is a resource, such as a room, and
748-
* not an actual person. TODO UNHIDE and add to ATTENDEE_TYPE comment
749-
*
750-
* @hide
743+
* This specifies that an attendee is a resource, like a room, a
744+
* cabbage, or something and not an actual person.
751745
*/
752746
public static final int TYPE_RESOURCE = 3;
753747

@@ -849,20 +843,17 @@ protected interface EventsColumns {
849843
public static final String EVENT_COLOR = "eventColor";
850844

851845
/**
852-
* A secondary color index for the individual event. NULL or an empty
853-
* string are reserved for indicating that the event does not use an
854-
* index for looking up the color. The provider will update
855-
* {@link #EVENT_COLOR} automatically when a valid index is written to
856-
* this column. The index must reference an existing row of the
846+
* A secondary color key for the individual event. NULL or an empty
847+
* string are reserved for indicating that the event does not use a key
848+
* for looking up the color. The provider will update
849+
* {@link #EVENT_COLOR} automatically when a valid key is written to
850+
* this column. The key must reference an existing row of the
857851
* {@link Colors} table. @see Colors
858852
* <P>
859853
* Type: TEXT
860854
* </P>
861-
* TODO UNHIDE
862-
*
863-
* @hide
864855
*/
865-
public static final String EVENT_COLOR_INDEX = "eventColor_index";
856+
public static final String EVENT_COLOR_KEY = "eventColor_index";
866857

867858
/**
868859
* The event status. Column name.
@@ -1020,8 +1011,10 @@ protected interface EventsColumns {
10201011
/**
10211012
* If this event counts as busy time or is still free time that can be
10221013
* scheduled over. Column name.
1023-
* <P>Type: INTEGER (One of {@link #AVAILABILITY_BUSY},
1024-
* {@link #AVAILABILITY_FREE})</P>
1014+
* <P>
1015+
* Type: INTEGER (One of {@link #AVAILABILITY_BUSY},
1016+
* {@link #AVAILABILITY_FREE}, {@link #AVAILABILITY_TENTATIVE})
1017+
* </P>
10251018
*/
10261019
public static final String AVAILABILITY = "availability";
10271020

@@ -1038,10 +1031,6 @@ protected interface EventsColumns {
10381031
/**
10391032
* Indicates that the owner's availability may change, but should be
10401033
* considered busy time that will conflict.
1041-
*
1042-
* TODO UNHIDE
1043-
*
1044-
* @hide
10451034
*/
10461035
public static final int AVAILABILITY_TENTATIVE = 2;
10471036

@@ -1418,6 +1407,7 @@ public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException
14181407
* <li>dtend if the event is non-recurring</li>
14191408
* <li>duration if the event is recurring</li>
14201409
* <li>rrule or rdate if the event is recurring</li>
1410+
* <li>eventTimezone</li>
14211411
* <li>a calendar_id</li>
14221412
* </ul>
14231413
* There are also further requirements when inserting or updating an event.
@@ -2306,10 +2296,6 @@ public static final boolean alarmExists(ContentResolver cr, long eventId,
23062296
}
23072297
}
23082298

2309-
/**
2310-
* @hide
2311-
* TODO UNHIDE
2312-
*/
23132299
protected interface ColorsColumns extends SyncStateContract.Columns {
23142300

23152301
/**
@@ -2331,14 +2317,14 @@ protected interface ColorsColumns extends SyncStateContract.Columns {
23312317
public static final int TYPE_EVENT = 1;
23322318

23332319
/**
2334-
* The index used to reference this color. This can be any non-empty
2320+
* The key used to reference this color. This can be any non-empty
23352321
* string, but must be unique for a given {@link #ACCOUNT_TYPE} and
23362322
* {@link #ACCOUNT_NAME}. Column name.
23372323
* <P>
23382324
* Type: TEXT
23392325
* </P>
23402326
*/
2341-
public static final String COLOR_INDEX = "color_index";
2327+
public static final String COLOR_KEY = "color_index";
23422328

23432329
/**
23442330
* The color as an 8-bit ARGB integer value. Colors should specify alpha
@@ -2356,14 +2342,11 @@ protected interface ColorsColumns extends SyncStateContract.Columns {
23562342

23572343
/**
23582344
* Fields for accessing colors available for a given account. Colors are
2359-
* referenced by {@link #COLOR_INDEX} which must be unique for a given
2345+
* referenced by {@link #COLOR_KEY} which must be unique for a given
23602346
* account name/type. These values can only be updated by the sync
23612347
* adapter. Only {@link #COLOR} may be updated after the initial insert. In
23622348
* addition, a row can only be deleted once all references to that color
23632349
* have been removed from the {@link Calendars} or {@link Events} tables.
2364-
* TODO UNHIDE
2365-
*
2366-
* @hide
23672350
*/
23682351
public static final class Colors implements ColorsColumns {
23692352
/**

0 commit comments

Comments
 (0)