summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt18
-rw-r--r--core/java/android/provider/ContactsContract.java126
-rw-r--r--media/java/android/media/MediaScanner.java18
3 files changed, 85 insertions, 77 deletions
diff --git a/api/current.txt b/api/current.txt
index 08cd44f..903b084 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -16391,8 +16391,6 @@ package android.provider {
}
protected static abstract interface ContactsContract.GroupsColumns {
- field public static final java.lang.String ACTION = "action";
- field public static final java.lang.String ACTION_URI = "action_uri";
field public static final java.lang.String AUTO_ADD = "auto_add";
field public static final java.lang.String DATA_SET = "data_set";
field public static final java.lang.String DELETED = "deleted";
@@ -16589,12 +16587,14 @@ package android.provider {
}
protected static abstract interface ContactsContract.StreamItemPhotosColumns {
- field public static final java.lang.String ACTION = "action";
- field public static final java.lang.String ACTION_URI = "action_uri";
field public static final java.lang.String PHOTO_FILE_ID = "photo_file_id";
field public static final java.lang.String PHOTO_URI = "photo_uri";
field public static final java.lang.String SORT_INDEX = "sort_index";
field public static final java.lang.String STREAM_ITEM_ID = "stream_item_id";
+ field public static final java.lang.String SYNC1 = "stream_item_photo_sync1";
+ field public static final java.lang.String SYNC2 = "stream_item_photo_sync2";
+ field public static final java.lang.String SYNC3 = "stream_item_photo_sync3";
+ field public static final java.lang.String SYNC4 = "stream_item_photo_sync4";
}
public static final class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
@@ -16609,13 +16609,19 @@ package android.provider {
}
protected static abstract interface ContactsContract.StreamItemsColumns {
- field public static final java.lang.String ACTION = "action";
- field public static final java.lang.String ACTION_URI = "action_uri";
+ field public static final java.lang.String ACCOUNT_NAME = "account_name";
+ field public static final java.lang.String ACCOUNT_TYPE = "account_type";
field public static final java.lang.String COMMENTS = "comments";
+ field public static final java.lang.String DATA_SET = "data_set";
field public static final java.lang.String RAW_CONTACT_ID = "raw_contact_id";
+ field public static final java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
field public static final java.lang.String RES_ICON = "icon";
field public static final java.lang.String RES_LABEL = "label";
field public static final java.lang.String RES_PACKAGE = "res_package";
+ field public static final java.lang.String SYNC1 = "stream_item_sync1";
+ field public static final java.lang.String SYNC2 = "stream_item_sync2";
+ field public static final java.lang.String SYNC3 = "stream_item_sync3";
+ field public static final java.lang.String SYNC4 = "stream_item_sync4";
field public static final java.lang.String TEXT = "text";
field public static final java.lang.String TIMESTAMP = "timestamp";
}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 5765dde..d867e35 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -2890,8 +2890,6 @@ public final class ContactsContract {
* values.put(StreamItems.TEXT, "Breakfasted at Tiffanys");
* values.put(StreamItems.TIMESTAMP, timestamp);
* values.put(StreamItems.COMMENTS, "3 people reshared this");
- * values.put(StreamItems.ACTION, action);
- * values.put(StreamItems.ACTION_URI, actionUri);
* Uri streamItemUri = getContentResolver().insert(
* Uri.withAppendedPath(ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId),
* RawContacts.StreamItems.CONTENT_DIRECTORY), values);
@@ -2905,8 +2903,6 @@ public final class ContactsContract {
* values.put(StreamItems.TEXT, "Breakfasted at Tiffanys");
* values.put(StreamItems.TIMESTAMP, timestamp);
* values.put(StreamItems.COMMENTS, "3 people reshared this");
- * values.put(StreamItems.ACTION, action);
- * values.put(StreamItems.ACTION_URI, actionUri);
* Uri streamItemUri = getContentResolver().insert(StreamItems.CONTENT_URI, values);
* long streamItemId = ContentUris.parseId(streamItemUri);
* </dd>
@@ -2924,8 +2920,6 @@ public final class ContactsContract {
* values.clear();
* values.put(StreamItemPhotos.SORT_INDEX, 1);
* values.put(StreamItemPhotos.PHOTO, photoData);
- * values.put(StreamItemPhotos.ACTION, action);
- * values.put(StreamItemPhotos.ACTION_URI, actionUri);
* getContentResolver().insert(Uri.withAppendedPath(
* ContentUris.withAppendedId(StreamItems.CONTENT_URI, streamItemId),
* StreamItems.StreamItemPhotos.CONTENT_DIRECTORY), values);
@@ -2938,8 +2932,6 @@ public final class ContactsContract {
* values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId);
* values.put(StreamItemPhotos.SORT_INDEX, 1);
* values.put(StreamItemPhotos.PHOTO, photoData);
- * values.put(StreamItemPhotos.ACTION, action);
- * values.put(StreamItemPhotos.ACTION_URI, actionUri);
* getContentResolver().insert(StreamItems.CONTENT_PHOTO_URI, values);
* </pre>
* Note that this latter form allows the insertion of a stream item and its
@@ -3081,16 +3073,56 @@ public final class ContactsContract {
public static final String RES_PACKAGE = "res_package";
/**
- * The resource ID of the icon for the source of the stream item.
- * This resource should be scoped by the {@link #RES_PACKAGE}.
- * <P>Type: NUMBER</P>
+ * The account type to which the raw_contact of this item is associated. See
+ * {@link RawContacts#ACCOUNT_TYPE}
+ *
+ * <p>TYPE: text</p>
+ * <p>read-only</p>
+ */
+ public static final String ACCOUNT_TYPE = "account_type";
+
+ /**
+ * The account name to which the raw_contact of this item is associated. See
+ * {@link RawContacts#ACCOUNT_NAME}
+ *
+ * <p>TYPE: text</p>
+ * <p>read-only</p>
+ */
+ public static final String ACCOUNT_NAME = "account_name";
+
+ /**
+ * The data set within the account that the raw_contact of this row belongs to. This allows
+ * multiple sync adapters for the same account type to distinguish between
+ * each others' data.
+ * {@link RawContacts#DATA_SET}
+ *
+ * <P>Type: TEXT</P>
+ * <p>read-only</p>
+ */
+ public static final String DATA_SET = "data_set";
+
+ /**
+ * The source_id of the raw_contact that this row belongs to.
+ * {@link RawContacts#SOURCE_ID}
+ *
+ * <P>Type: TEXT</P>
+ * <p>read-only</p>
+ */
+ public static final String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
+
+ /**
+ * The resource name of the icon for the source of the stream item.
+ * This resource should be scoped by the {@link #RES_PACKAGE}. As this can only reference
+ * drawables, the "@drawable/" prefix must be omitted.
+ * <P>Type: TEXT</P>
*/
public static final String RES_ICON = "icon";
/**
- * The resource ID of the label describing the source of the status update, e.g. "Google
- * Talk". This resource should be scoped by the {@link #RES_PACKAGE}.
- * <p>Type: NUMBER</p>
+ * The resource name of the label describing the source of the status update, e.g. "Google
+ * Talk". This resource should be scoped by the {@link #RES_PACKAGE}. As this can only
+ * reference strings, the "@string/" prefix must be omitted.
+ * <p>Type: TEXT</p>
*/
public static final String RES_LABEL = "label";
@@ -3136,18 +3168,14 @@ public final class ContactsContract {
*/
public static final String COMMENTS = "comments";
- /**
- * The activity action to execute when the item is tapped.
- * <P>Type: TEXT</P>
- */
- public static final String ACTION = "action";
-
- /**
- * The URI that is launched when the item is pressed. May be handled by
- * the source app, but could also reference a website (e.g. YouTube).
- * <P>Type: TEXT</P>
- */
- public static final String ACTION_URI = "action_uri";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC1 = "stream_item_sync1";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC2 = "stream_item_sync2";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC3 = "stream_item_sync3";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC4 = "stream_item_sync4";
}
/**
@@ -3171,8 +3199,6 @@ public final class ContactsContract {
* ContentValues values = new ContentValues();
* values.put(StreamItemPhotos.SORT_INDEX, 1);
* values.put(StreamItemPhotos.PHOTO, photoData);
- * values.put(StreamItemPhotos.ACTION, action);
- * values.put(StreamItemPhotos.ACTION_URI, actionUri);
* Uri photoUri = getContentResolver().insert(Uri.withAppendedPath(
* ContentUris.withAppendedId(StreamItems.CONTENT_URI, streamItemId)
* StreamItems.StreamItemPhotos#CONTENT_DIRECTORY), values);
@@ -3186,8 +3212,6 @@ public final class ContactsContract {
* values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId);
* values.put(StreamItemPhotos.SORT_INDEX, 1);
* values.put(StreamItemPhotos.PHOTO, photoData);
- * values.put(StreamItemPhotos.ACTION, action);
- * values.put(StreamItemPhotos.ACTION_URI, actionUri);
* Uri photoUri = getContentResolver().insert(StreamItems.CONTENT_PHOTO_URI, values);
* long photoId = ContentUris.parseId(photoUri);
* </pre>
@@ -3353,18 +3377,14 @@ public final class ContactsContract {
*/
public static final String PHOTO_URI = "photo_uri";
- /**
- * The activity action to execute when the photo is tapped.
- * <P>Type: TEXT</P>
- */
- public static final String ACTION = "action";
-
- /**
- * The URI that is launched when the photo is pressed. May be handled by
- * the source app, but could also reference a website (e.g. YouTube).
- * <P>Type: TEXT</P>
- */
- public static final String ACTION_URI = "action_uri";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC1 = "stream_item_photo_sync1";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC2 = "stream_item_photo_sync2";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC3 = "stream_item_photo_sync3";
+ /** Generic column for use by sync adapters. */
+ public static final String SYNC4 = "stream_item_photo_sync4";
}
/**
@@ -6496,28 +6516,6 @@ public final class ContactsContract {
public static final String NOTES = "notes";
/**
- * The Activity action to open the group in the source app (e.g.
- * {@link Intent#ACTION_VIEW}). Can be NULL if the group does not have a dedicated viewer.
- * This is used in conjunction with {@link #ACTION_URI}: In order to show an "Open in
- * (sourceapp)"-button, both of these fields must be set
- * <p>
- * Type: TEXT
- */
- public static final String ACTION = "action";
-
-
- /**
- * Uri to open the group in the source app.
- * Can be NULL if the group does not have a dedicated viewer.
- * This is used in conjunction with {@link #ACTION}: In order to show an "Open in
- * (sourceapp)"-button, both of these fields must be set
- * <p>
- * Type: TEXT
- */
- public static final String ACTION_URI = "action_uri";
-
-
- /**
* The ID of this group if it is a System Group, i.e. a group that has a special meaning
* to the sync adapter, null otherwise.
* <P>Type: TEXT</P>
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 2d1761f..65818a1 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -1122,19 +1122,23 @@ public class MediaScanner
}
if (fileMissing) {
+ // Clear the file path to prevent the _DELETE_FILE database hook
+ // in the media provider from deleting the file.
+ // If the file is truly gone the delete is unnecessary, and we want to avoid
+ // accidentally deleting files that are really there.
+ ContentValues values = new ContentValues();
+ values.put(Files.FileColumns.DATA, "");
+ values.put(Files.FileColumns.DATE_MODIFIED, 0);
+ mMediaProvider.update(ContentUris.withAppendedId(mFilesUri, entry.mRowId),
+ values, null, null);
+
// do not delete missing playlists, since they may have been modified by the user.
// the user can delete them in the media player instead.
// instead, clear the path and lastModified fields in the row
MediaFile.MediaFileType mediaFileType = MediaFile.getFileType(path);
int fileType = (mediaFileType == null ? 0 : mediaFileType.fileType);
- if (MediaFile.isPlayListFileType(fileType)) {
- ContentValues values = new ContentValues();
- values.put(MediaStore.Audio.Playlists.DATA, "");
- values.put(MediaStore.Audio.Playlists.DATE_MODIFIED, 0);
- mMediaProvider.update(ContentUris.withAppendedId(mPlaylistsUri, entry.mRowId),
- values, null, null);
- } else {
+ if (!MediaFile.isPlayListFileType(fileType)) {
mMediaProvider.delete(ContentUris.withAppendedId(mFilesUri, entry.mRowId),
null, null);
iterator.remove();