diff options
author | Yao Chen <yaochen@google.com> | 2014-07-21 23:36:24 -0700 |
---|---|---|
committer | Yao Chen <yaochen@google.com> | 2014-07-22 17:05:04 -0700 |
commit | 319f9a979c1c10c0c15ca50ee20e0a05e932cbb7 (patch) | |
tree | 0c3e588c61f92398168c7a0d5291be6c8c5a4111 /tests | |
parent | 71f6ad31cfc6ae8ab89ad08586d5242aa2236e22 (diff) | |
download | frameworks_base-319f9a979c1c10c0c15ca50ee20e0a05e932cbb7.zip frameworks_base-319f9a979c1c10c0c15ca50ee20e0a05e932cbb7.tar.gz frameworks_base-319f9a979c1c10c0c15ca50ee20e0a05e932cbb7.tar.bz2 |
Add thumbnail related api.
Change-Id: Ifcb06bbaf8f37df367f130124cbcef065fa25766
Diffstat (limited to 'tests')
-rw-r--r-- | tests/MusicServiceDemo/src/com/example/android/musicservicedemo/BrowserService.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/MusicServiceDemo/src/com/example/android/musicservicedemo/BrowserService.java b/tests/MusicServiceDemo/src/com/example/android/musicservicedemo/BrowserService.java index 9ca156f..e5216b5 100644 --- a/tests/MusicServiceDemo/src/com/example/android/musicservicedemo/BrowserService.java +++ b/tests/MusicServiceDemo/src/com/example/android/musicservicedemo/BrowserService.java @@ -31,6 +31,7 @@ import android.media.MediaPlayer.OnErrorListener; import android.media.MediaPlayer.OnPreparedListener; import android.media.browse.MediaBrowserItem; import android.media.browse.MediaBrowserService; +import android.media.browse.MediaBrowserService.BrowserRoot; import android.media.session.MediaSession; import android.net.Uri; import android.net.wifi.WifiManager; @@ -115,24 +116,27 @@ public class BrowserService extends MediaBrowserService { } @Override - public Uri onGetRoot(String clientPackageName, int clientUid, Bundle rootHints) { - return BROWSE_URI; + protected BrowserRoot onGetRoot(String clientPackageName, int clientUid, Bundle rootHints) { + return new BrowserRoot(BROWSE_URI, null); } @Override - public List<MediaBrowserItem> onLoadChildren(Uri parentUri) { + protected List<MediaBrowserItem> onLoadChildren(Uri parentUri) { final ArrayList<MediaBrowserItem> results = new ArrayList(); for (int i=0; i<10; i++) { - results.add(new MediaBrowserItem.Builder(Uri.withAppendedPath(BASE_URI, Integer.toString(i)), - MediaBrowserItem.FLAG_BROWSABLE, "Title " + i).setSummary("Summary " + i).build()); + results.add(new MediaBrowserItem.Builder( + Uri.withAppendedPath(BASE_URI, Integer.toString(i)), + MediaBrowserItem.FLAG_BROWSABLE, "Title " + i) + .setSummary("Summary " + i) + .build()); } return results; } @Override - public Bitmap onGetThumbnail(Uri uri, int width, int height, int density) { + protected Bitmap onGetThumbnail(Uri uri, int width, int height) { return null; } |