|
19 | 19 |
|
20 | 20 | import android.annotation.SdkConstant; |
21 | 21 | import android.annotation.SdkConstant.SdkConstantType; |
| 22 | +import android.app.Activity; |
22 | 23 | import android.app.AlarmManager; |
23 | 24 | import android.app.PendingIntent; |
24 | 25 | import android.content.ContentProviderClient; |
@@ -97,6 +98,32 @@ public final class CalendarContract { |
97 | 98 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
98 | 99 | public static final String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER"; |
99 | 100 |
|
| 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 | + |
100 | 127 | /** |
101 | 128 | * Intent Extras key: The start time of an event or an instance of a |
102 | 129 | * recurring event. (milliseconds since epoch) |
@@ -1176,6 +1203,22 @@ protected interface EventsColumns { |
1176 | 1203 | * <P>Type: INTEGER (boolean, readonly)</P> |
1177 | 1204 | */ |
1178 | 1205 | 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 | + |
1179 | 1222 | } |
1180 | 1223 |
|
1181 | 1224 | /** |
|
0 commit comments