Skip to content

Commit 27e2fa4

Browse files
Michael ChanAndroid (Google) Code Review
authored andcommitted
Merge "Added columns to store package name and uri to a custom app"
2 parents 59a422e + 37960c7 commit 27e2fa4

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

api/current.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16321,12 +16321,14 @@ package android.provider {
1632116321
public final class CalendarContract {
1632216322
field public static final java.lang.String ACCOUNT_TYPE_LOCAL = "LOCAL";
1632316323
field public static final java.lang.String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER";
16324+
field public static final java.lang.String ACTION_HANDLE_CUSTOM_EVENT = "android.intent.action.HANDLE_CUSTOM_EVENT";
1632416325
field public static final java.lang.String AUTHORITY = "com.android.calendar";
1632516326
field public static final java.lang.String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
1632616327
field public static final android.net.Uri CONTENT_URI;
1632716328
field public static final java.lang.String EXTRA_EVENT_ALL_DAY = "allDay";
1632816329
field public static final java.lang.String EXTRA_EVENT_BEGIN_TIME = "beginTime";
1632916330
field public static final java.lang.String EXTRA_EVENT_END_TIME = "endTime";
16331+
field public static final java.lang.String EXTRA_EVENT_URI = "eventUri";
1633016332
}
1633116333

1633216334
public static final class CalendarContract.Attendees implements android.provider.BaseColumns android.provider.CalendarContract.AttendeesColumns android.provider.CalendarContract.EventsColumns {
@@ -16485,6 +16487,8 @@ package android.provider {
1648516487
field public static final int AVAILABILITY_TENTATIVE = 2; // 0x2
1648616488
field public static final java.lang.String CALENDAR_ID = "calendar_id";
1648716489
field public static final java.lang.String CAN_INVITE_OTHERS = "canInviteOthers";
16490+
field public static final java.lang.String CUSTOM_APP_PACKAGE = "customAppPackage";
16491+
field public static final java.lang.String CUSTOM_APP_URI = "customAppUri";
1648816492
field public static final java.lang.String DESCRIPTION = "description";
1648916493
field public static final java.lang.String DISPLAY_COLOR = "displayColor";
1649016494
field public static final java.lang.String DTEND = "dtend";

core/java/android/provider/CalendarContract.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import android.annotation.SdkConstant;
2121
import android.annotation.SdkConstant.SdkConstantType;
22+
import android.app.Activity;
2223
import android.app.AlarmManager;
2324
import android.app.PendingIntent;
2425
import android.content.ContentProviderClient;
@@ -97,6 +98,32 @@ public final class CalendarContract {
9798
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
9899
public static final String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER";
99100

101+
/**
102+
* Activity Action: Display the event to the user in the custom app as
103+
* specified in {@link EventsColumns#CUSTOM_APP_PACKAGE}. The custom app
104+
* will be started via {@link Activity#startActivityForResult(Intent, int)}
105+
* and it should call {@link Activity#setResult(int)} with
106+
* {@link Activity#RESULT_OK} or {@link Activity#RESULT_CANCELED} to
107+
* acknowledge whether the action was handled or not.
108+
* <p>
109+
* Input: {@link Intent#getData} has the event URI. The extra
110+
* {@link #EXTRA_EVENT_BEGIN_TIME} has the start time of the instance. The
111+
* extra {@link #EXTRA_CUSTOM_APP_URI} will have the
112+
* {@link EventsColumns#CUSTOM_APP_URI}.
113+
* <p>
114+
* Output: {@link Activity#RESULT_OK} if this was handled; otherwise
115+
* {@link Activity#RESULT_CANCELED}
116+
*/
117+
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
118+
public static final String ACTION_HANDLE_CUSTOM_EVENT =
119+
"android.provider.calendar.action.HANDLE_CUSTOM_EVENT";
120+
121+
/**
122+
* Intent Extras key: {@link EventsColumns#CUSTOM_APP_URI} for the event in
123+
* the {@link #ACTION_HANDLE_CUSTOM_EVENT} intent
124+
*/
125+
public static final String EXTRA_CUSTOM_APP_URI = "eventUri";
126+
100127
/**
101128
* Intent Extras key: The start time of an event or an instance of a
102129
* recurring event. (milliseconds since epoch)
@@ -1176,6 +1203,22 @@ protected interface EventsColumns {
11761203
* <P>Type: INTEGER (boolean, readonly)</P>
11771204
*/
11781205
public static final String CAN_INVITE_OTHERS = "canInviteOthers";
1206+
1207+
/**
1208+
* The package name of the custom app that can provide a richer
1209+
* experience for the event. See the ACTION TYPE
1210+
* {@link CalendarContract#ACTION_HANDLE_CUSTOM_EVENT} for details.
1211+
* Column name.
1212+
* <P> Type: TEXT </P>
1213+
*/
1214+
public static final String CUSTOM_APP_PACKAGE = "customAppPackage";
1215+
1216+
/**
1217+
* The URI used by the custom app for the event. Column name.
1218+
* <P>Type: TEXT</P>
1219+
*/
1220+
public static final String CUSTOM_APP_URI = "customAppUri";
1221+
11791222
}
11801223

11811224
/**

0 commit comments

Comments
 (0)