diff --git a/api/current.txt b/api/current.txt index c912541c63b7e..0404185837a17 100644 --- a/api/current.txt +++ b/api/current.txt @@ -16321,12 +16321,14 @@ package android.provider { public final class CalendarContract { field public static final java.lang.String ACCOUNT_TYPE_LOCAL = "LOCAL"; field public static final java.lang.String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER"; + field public static final java.lang.String ACTION_HANDLE_CUSTOM_EVENT = "android.intent.action.HANDLE_CUSTOM_EVENT"; field public static final java.lang.String AUTHORITY = "com.android.calendar"; field public static final java.lang.String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter"; field public static final android.net.Uri CONTENT_URI; field public static final java.lang.String EXTRA_EVENT_ALL_DAY = "allDay"; field public static final java.lang.String EXTRA_EVENT_BEGIN_TIME = "beginTime"; field public static final java.lang.String EXTRA_EVENT_END_TIME = "endTime"; + field public static final java.lang.String EXTRA_EVENT_URI = "eventUri"; } 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 { field public static final int AVAILABILITY_TENTATIVE = 2; // 0x2 field public static final java.lang.String CALENDAR_ID = "calendar_id"; field public static final java.lang.String CAN_INVITE_OTHERS = "canInviteOthers"; + field public static final java.lang.String CUSTOM_APP_PACKAGE = "customAppPackage"; + field public static final java.lang.String CUSTOM_APP_URI = "customAppUri"; field public static final java.lang.String DESCRIPTION = "description"; field public static final java.lang.String DISPLAY_COLOR = "displayColor"; field public static final java.lang.String DTEND = "dtend"; diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java index c4aa6911b50c6..f6a6da6b22974 100644 --- a/core/java/android/provider/CalendarContract.java +++ b/core/java/android/provider/CalendarContract.java @@ -19,6 +19,7 @@ package android.provider; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; +import android.app.Activity; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.ContentProviderClient; @@ -97,6 +98,32 @@ public final class CalendarContract { @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_EVENT_REMINDER = "android.intent.action.EVENT_REMINDER"; + /** + * Activity Action: Display the event to the user in the custom app as + * specified in {@link EventsColumns#CUSTOM_APP_PACKAGE}. The custom app + * will be started via {@link Activity#startActivityForResult(Intent, int)} + * and it should call {@link Activity#setResult(int)} with + * {@link Activity#RESULT_OK} or {@link Activity#RESULT_CANCELED} to + * acknowledge whether the action was handled or not. + *

+ * Input: {@link Intent#getData} has the event URI. The extra + * {@link #EXTRA_EVENT_BEGIN_TIME} has the start time of the instance. The + * extra {@link #EXTRA_CUSTOM_APP_URI} will have the + * {@link EventsColumns#CUSTOM_APP_URI}. + *

+ * Output: {@link Activity#RESULT_OK} if this was handled; otherwise + * {@link Activity#RESULT_CANCELED} + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_HANDLE_CUSTOM_EVENT = + "android.provider.calendar.action.HANDLE_CUSTOM_EVENT"; + + /** + * Intent Extras key: {@link EventsColumns#CUSTOM_APP_URI} for the event in + * the {@link #ACTION_HANDLE_CUSTOM_EVENT} intent + */ + public static final String EXTRA_CUSTOM_APP_URI = "eventUri"; + /** * Intent Extras key: The start time of an event or an instance of a * recurring event. (milliseconds since epoch) @@ -1176,6 +1203,22 @@ public final class CalendarContract { *

Type: INTEGER (boolean, readonly)

*/ public static final String CAN_INVITE_OTHERS = "canInviteOthers"; + + /** + * The package name of the custom app that can provide a richer + * experience for the event. See the ACTION TYPE + * {@link CalendarContract#ACTION_HANDLE_CUSTOM_EVENT} for details. + * Column name. + *

Type: TEXT

+ */ + public static final String CUSTOM_APP_PACKAGE = "customAppPackage"; + + /** + * The URI used by the custom app for the event. Column name. + *

Type: TEXT

+ */ + public static final String CUSTOM_APP_URI = "customAppUri"; + } /**