summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <chanm@google.com>2012-04-19 00:18:13 -0700
committerMichael Chan <chanm@google.com>2012-04-19 15:43:45 -0700
commit37960c7f58197404d2331a0ea81194ffc98552c1 (patch)
tree670dac35695e7170abc675b1bb2612b8ef86f10f
parentb7c30a847ae3526cee28e2e3e96b010a6fe7961c (diff)
downloadframeworks_base-37960c7f58197404d2331a0ea81194ffc98552c1.zip
frameworks_base-37960c7f58197404d2331a0ea81194ffc98552c1.tar.gz
frameworks_base-37960c7f58197404d2331a0ea81194ffc98552c1.tar.bz2
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
-rw-r--r--api/current.txt4
-rw-r--r--core/java/android/provider/CalendarContract.java43
2 files changed, 47 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index d8387c1..fd68abc 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -16281,12 +16281,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 {
@@ -16445,6 +16447,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 c4aa691..f6a6da6 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;
@@ -98,6 +99,32 @@ public final class CalendarContract {
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.
+ * <p>
+ * 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}.
+ * <p>
+ * 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 {
* <P>Type: INTEGER (boolean, readonly)</P>
*/
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.
+ * <P> Type: TEXT </P>
+ */
+ public static final String CUSTOM_APP_PACKAGE = "customAppPackage";
+
+ /**
+ * The URI used by the custom app for the event. Column name.
+ * <P>Type: TEXT</P>
+ */
+ public static final String CUSTOM_APP_URI = "customAppUri";
+
}
/**