diff --git a/api/current.xml b/api/current.xml
index d18b5e660270c..afd9c7a1f2164 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -113230,37 +113230,6 @@
>
-
-
-
-
-
-
+
+
+
+
+
+
> contentValuesListMap) {
final List contentValuesList = contentValuesListMap
- .get(Birthday.CONTENT_ITEM_TYPE);
+ .get(Event.CONTENT_ITEM_TYPE);
if (contentValuesList != null && contentValuesList.size() > 0) {
+ Integer eventType = contentValuesList.get(0).getAsInteger(Event.TYPE);
+ if (eventType == null || !eventType.equals(Event.TYPE_BIRTHDAY)) {
+ return;
+ }
// Theoretically, there must be only one birthday for each vCard data and
// we are afraid of some parse error occuring in some devices, so
// we emit only one birthday entry for now.
- String birthday = contentValuesList.get(0).getAsString(Birthday.BIRTHDAY);
+ String birthday = contentValuesList.get(0).getAsString(Event.START_DATE);
if (birthday != null) {
birthday = birthday.trim();
}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 166813643b533..40a3c4f706048 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -1691,26 +1691,6 @@ public final class ContactsContract {
}
}
- /**
- * Common data definition for birthdays.
- */
- public static final class Birthday implements DataColumnsWithJoins {
- /**
- * This utility class cannot be instantiated
- */
- private Birthday() {}
-
- /** MIME type used when storing this in data table. */
- public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/birthday";
-
- /**
- * The birthday. This must be of the form YYYY-MM-DD or YYYY-MM-DDThh:mm:ss
- * These are xs:date and xs:dateTime
- * Type: TEXT
- */
- public static final String BIRTHDAY = DATA1;
- }
-
/**
* Common data definition for relations.
*/
@@ -1755,16 +1735,34 @@ public final class ContactsContract {
private Event() {}
/** MIME type used when storing this in data table. */
- public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/event";
+ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_event";
public static final int TYPE_ANNIVERSARY = 1;
public static final int TYPE_OTHER = 2;
+ public static final int TYPE_BIRTHDAY = 3;
/**
* The event start date as the user entered it.
* Type: TEXT
*/
public static final String START_DATE = DATA;
+
+ /**
+ * Return the string resource that best describes the given
+ * {@link #TYPE}. Will always return a valid resource.
+ */
+ public static int getTypeResource(Integer type) {
+ if (type == null) {
+ return com.android.internal.R.string.eventTypeOther;
+ }
+ switch (type) {
+ case TYPE_ANNIVERSARY:
+ return com.android.internal.R.string.eventTypeAnniversary;
+ case TYPE_BIRTHDAY: return com.android.internal.R.string.eventTypeBirthday;
+ case TYPE_OTHER: return com.android.internal.R.string.eventTypeOther;
+ default: return com.android.internal.R.string.eventTypeOther;
+ }
+ }
}
/**
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 7191a4669037f..7760db198f67e 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1243,6 +1243,13 @@
MMS
+
+ Birthday
+
+ Anniversary
+
+ Event
+
Custom
@@ -1299,7 +1306,7 @@
Other
Custom
-
+
Via %1$s