summaryrefslogtreecommitdiffstats
path: root/tests/MusicBrowserDemo
diff options
context:
space:
mode:
authorRoboErik <epastern@google.com>2014-08-29 15:16:19 -0700
committerRoboErik <epastern@google.com>2014-08-29 15:16:19 -0700
commitc692d05951561e1d9fde952cc5389ec167bdb7bb (patch)
tree484cbe75b1eb0a6671008be8452f1c3577c8e9a6 /tests/MusicBrowserDemo
parentcd74270da7a7320904f14a465b8902dd5ea56f1d (diff)
downloadframeworks_base-c692d05951561e1d9fde952cc5389ec167bdb7bb.zip
frameworks_base-c692d05951561e1d9fde952cc5389ec167bdb7bb.tar.gz
frameworks_base-c692d05951561e1d9fde952cc5389ec167bdb7bb.tar.bz2
Update MediaBrowser to use String ids instead of Uris
Since we converted MediaDescription over to using a String media id for identifying everything we should also use Strings in the browser service to make it clear that it should re-use that field. bug:17333205 Change-Id: I5fd5762bdad05068f5b1aa36074306b43432e686
Diffstat (limited to 'tests/MusicBrowserDemo')
-rw-r--r--tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java b/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java
index 64602d52..8cc9b97 100644
--- a/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java
+++ b/tests/MusicBrowserDemo/src/com/example/android/musicbrowserdemo/BrowserListFragment.java
@@ -47,12 +47,12 @@ public class BrowserListFragment extends ListFragment {
// For args
public static final String ARG_COMPONENT = "component";
- public static final String ARG_URI = "uri";
+ public static final String ARG_ID = "uri";
private Adapter mAdapter;
private List<Item> mItems = new ArrayList();
private ComponentName mComponent;
- private Uri mUri;
+ private String mNodeId;
private MediaBrowser mBrowser;
private static class Item {
@@ -76,7 +76,7 @@ public class BrowserListFragment extends ListFragment {
// Get our arguments
final Bundle args = getArguments();
mComponent = args.getParcelable(ARG_COMPONENT);
- mUri = args.getParcelable(ARG_URI);
+ mNodeId = args.getString(ARG_ID);
// A hint about who we are, so the service can customize the results if it wants to.
final Bundle rootHints = new Bundle();
@@ -108,7 +108,7 @@ public class BrowserListFragment extends ListFragment {
final Bundle args = new Bundle();
args.putParcelable(BrowserListFragment.ARG_COMPONENT, mComponent);
- args.putParcelable(BrowserListFragment.ARG_URI, item.media.getDescription().getIconUri());
+ args.putParcelable(BrowserListFragment.ARG_ID, item.media.getDescription().getIconUri());
fragment.setArguments(args);
getFragmentManager().beginTransaction()
@@ -124,14 +124,14 @@ public class BrowserListFragment extends ListFragment {
@Override
public void onConnected() {
Log.d(TAG, "mConnectionCallbacks.onConnected");
- if (mUri == null) {
- mUri = mBrowser.getRoot();
+ if (mNodeId == null) {
+ mNodeId = mBrowser.getRoot();
}
- mBrowser.subscribe(mUri, new MediaBrowser.SubscriptionCallback() {
+ mBrowser.subscribe(mNodeId, new MediaBrowser.SubscriptionCallback() {
@Override
- public void onChildrenLoaded(Uri parentUri,
+ public void onChildrenLoaded(String parentId,
List<MediaBrowser.MediaItem> children) {
- Log.d(TAG, "onChildrenLoaded parentUri=" + parentUri
+ Log.d(TAG, "onChildrenLoaded parentId=" + parentId
+ " children= " + children);
mItems.clear();
final int N = children.size();
@@ -142,8 +142,8 @@ public class BrowserListFragment extends ListFragment {
}
@Override
- public void onError(Uri parentUri) {
- Log.d(TAG, "onError parentUri=" + parentUri);
+ public void onError(String parentId) {
+ Log.d(TAG, "onError parentId=" + parentId);
}
});
}