Skip to content

Commit 37960c7

Browse files
author
Michael Chan
committed
Added columns to store package name and uri to a custom app
that provides a richer experience for an event. Bug: 6325441 Change-Id: I7497a1508d196ec4ef97c60100278a70c424d9e2
1 parent b7c30a8 commit 37960c7

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
@@ -16281,12 +16281,14 @@ package android.provider {
1628116281
public final class CalendarContract {
1628216282
field public static final java.lang.String ACCOUNT_TYPE_LOCAL = "LOCAL";
1628316283
field public static final java.lang.String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER";
16284+
field public static final java.lang.String ACTION_HANDLE_CUSTOM_EVENT = "android.intent.action.HANDLE_CUSTOM_EVENT";
1628416285
field public static final java.lang.String AUTHORITY = "com.android.calendar";
1628516286
field public static final java.lang.String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
1628616287
field public static final android.net.Uri CONTENT_URI;
1628716288
field public static final java.lang.String EXTRA_EVENT_ALL_DAY = "allDay";
1628816289
field public static final java.lang.String EXTRA_EVENT_BEGIN_TIME = "beginTime";
1628916290
field public static final java.lang.String EXTRA_EVENT_END_TIME = "endTime";
16291+
field public static final java.lang.String EXTRA_EVENT_URI = "eventUri";
1629016292
}
1629116293

1629216294
public static final class CalendarContract.Attendees implements android.provider.BaseColumns android.provider.CalendarContract.AttendeesColumns android.provider.CalendarContract.EventsColumns {
@@ -16445,6 +16447,8 @@ package android.provider {
1644516447
field public static final int AVAILABILITY_TENTATIVE = 2; // 0x2
1644616448
field public static final java.lang.String CALENDAR_ID = "calendar_id";
1644716449
field public static final java.lang.String CAN_INVITE_OTHERS = "canInviteOthers";
16450+
field public static final java.lang.String CUSTOM_APP_PACKAGE = "customAppPackage";
16451+
field public static final java.lang.String CUSTOM_APP_URI = "customAppUri";
1644816452
field public static final java.lang.String DESCRIPTION = "description";
1644916453
field public static final java.lang.String DISPLAY_COLOR = "displayColor";
1645016454
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)