summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-12-09 14:22:47 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-12-09 14:22:47 -0800
commit7cd4029473431c56100e52f631b9733829dc3171 (patch)
treedaa38fad129d004821c4d81a3dfbcb50e8322139 /core/java
parentc7f7c94034ea0708161af9f718678c70b13c9a8d (diff)
parent6b0ca015654b034cfcc01ad62091837ab5734115 (diff)
downloadframeworks_base-7cd4029473431c56100e52f631b9733829dc3171.zip
frameworks_base-7cd4029473431c56100e52f631b9733829dc3171.tar.gz
frameworks_base-7cd4029473431c56100e52f631b9733829dc3171.tar.bz2
Merge change I2cb78a66 into eclair-mr2
* changes: Add convenience function to MediaStore to move a playlist item to a different location.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/provider/MediaStore.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index a796fe9..ae53dbe2 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -1252,6 +1252,28 @@ public final class MediaStore {
}
/**
+ * Convenience method to move a playlist item to a new location
+ * @param res The content resolver to use
+ * @param playlistId The numeric id of the playlist
+ * @param from The position of the item to move
+ * @param to The position to move the item to
+ * @return true on success
+ * @hide
+ */
+ public static final boolean moveItem(ContentResolver res,
+ long playlistId, int from, int to) {
+ Uri uri = MediaStore.Audio.Playlists.Members.getContentUri("external",
+ playlistId)
+ .buildUpon()
+ .appendEncodedPath(String.valueOf(from))
+ .appendQueryParameter("move", "true")
+ .build();
+ ContentValues values = new ContentValues();
+ values.put(MediaStore.Audio.Playlists.Members.PLAY_ORDER, to);
+ return res.update(uri, values, null, null) != 0;
+ }
+
+ /**
* The ID within the playlist.
*/
public static final String _ID = "_id";