summaryrefslogtreecommitdiffstats
path: root/tests/MusicBrowserDemo
diff options
context:
space:
mode:
authorRoboErik <epastern@google.com>2014-08-28 16:23:43 -0700
committerErik Pasternak <roboerik@android.com>2014-08-28 23:37:22 +0000
commit6a6a8f00946f963191612f64238bd706c2188dd8 (patch)
tree9672e8d9df690bf49fe63c9ddd71daadec6e3f73 /tests/MusicBrowserDemo
parentd6b03eecf05441b28272e11a4e50177a0fbc78c7 (diff)
downloadframeworks_base-6a6a8f00946f963191612f64238bd706c2188dd8.zip
frameworks_base-6a6a8f00946f963191612f64238bd706c2188dd8.tar.gz
frameworks_base-6a6a8f00946f963191612f64238bd706c2188dd8.tar.bz2
Fix test build
Updates for MediaBrowser APIs. I missed some new demos that had been added which use these APIs. Change-Id: Ic42c9ba20a851c5b08c564cfc4de71bbe09ebdb9
Diffstat (limited to 'tests/MusicBrowserDemo')
-rw-r--r--tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/AppListFragment.java2
-rw-r--r--tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java16
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/AppListFragment.java b/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/AppListFragment.java
index 526ea5d..50633db 100644
--- a/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/AppListFragment.java
+++ b/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/AppListFragment.java
@@ -21,7 +21,7 @@ import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.media.browse.MediaBrowserService;
+import android.service.media.MediaBrowserService;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
diff --git a/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java b/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java
index 2fc77dc..64602d52 100644
--- a/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java
+++ b/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java
@@ -22,8 +22,7 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.media.browse.MediaBrowser;
-import android.media.browse.MediaBrowserItem;
-import android.media.browse.MediaBrowserService;
+import android.service.media.MediaBrowserService;
import android.os.Bundle;
import android.net.Uri;
import android.support.v4.app.FragmentActivity;
@@ -57,9 +56,9 @@ public class BrowserListFragment extends ListFragment {
private MediaBrowser mBrowser;
private static class Item {
- final MediaBrowserItem media;
+ final MediaBrowser.MediaItem media;
- Item(MediaBrowserItem m) {
+ Item(MediaBrowser.MediaItem m) {
this.media = m;
}
}
@@ -103,13 +102,13 @@ public class BrowserListFragment extends ListFragment {
final Item item = mItems.get(position);
Log.i("BrowserListFragment", "Item clicked: " + position + " -- "
- + mAdapter.getItem(position).media.getUri());
+ + mAdapter.getItem(position).media.getDescription().getIconUri());
final BrowserListFragment fragment = new BrowserListFragment();
final Bundle args = new Bundle();
args.putParcelable(BrowserListFragment.ARG_COMPONENT, mComponent);
- args.putParcelable(BrowserListFragment.ARG_URI, item.media.getUri());
+ args.putParcelable(BrowserListFragment.ARG_URI, item.media.getDescription().getIconUri());
fragment.setArguments(args);
getFragmentManager().beginTransaction()
@@ -130,7 +129,8 @@ public class BrowserListFragment extends ListFragment {
}
mBrowser.subscribe(mUri, new MediaBrowser.SubscriptionCallback() {
@Override
- public void onChildrenLoaded(Uri parentUri, List<MediaBrowserItem> children) {
+ public void onChildrenLoaded(Uri parentUri,
+ List<MediaBrowser.MediaItem> children) {
Log.d(TAG, "onChildrenLoaded parentUri=" + parentUri
+ " children= " + children);
mItems.clear();
@@ -197,7 +197,7 @@ public class BrowserListFragment extends ListFragment {
final TextView tv = (TextView)convertView;
final Item item = mItems.get(position);
- tv.setText(item.media.getTitle());
+ tv.setText(item.media.getDescription().getTitle());
return convertView;
}