Update media router API.
Bug: 8175766
Change-Id: Id6f895e3c6339eee83cb616816dab8f77f5b54ce
diff --git a/samples/Support7Demos/res/drawable-hdpi/media_route_icon.png b/samples/Support7Demos/res/drawable-hdpi/media_route_icon.png
deleted file mode 100755
index 66a1984..0000000
--- a/samples/Support7Demos/res/drawable-hdpi/media_route_icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/Support7Demos/res/drawable-mdpi/media_route_icon.png b/samples/Support7Demos/res/drawable-mdpi/media_route_icon.png
deleted file mode 100644
index 5ae7701..0000000
--- a/samples/Support7Demos/res/drawable-mdpi/media_route_icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/Support7Demos/res/values/strings.xml b/samples/Support7Demos/res/values/strings.xml
index 1c9f6ff..5cafc80 100644
--- a/samples/Support7Demos/res/values/strings.xml
+++ b/samples/Support7Demos/res/values/strings.xml
@@ -32,6 +32,7 @@
<string name="sample_media_route_provider_service">Media Route Provider Service Support Library Sample</string>
<string name="fixed_volume_route_name">Fixed Volume Remote Playback Route</string>
<string name="variable_volume_route_name">Variable Volume Remote Playback Route</string>
+ <string name="sample_route_description">Sample route from Support7Demos</string>
<!-- GridLayout -->
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java b/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java
index 8a80bac..ebf7e29 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java
@@ -122,8 +122,8 @@
MediaRouteDescriptor routeDescriptor1 = new MediaRouteDescriptor.Builder(
FIXED_VOLUME_ROUTE_ID,
r.getString(R.string.fixed_volume_route_name))
+ .setDescription(r.getString(R.string.sample_route_description))
.addControlFilters(CONTROL_FILTERS)
- .setIconResource(R.drawable.media_route_icon)
.setPlaybackType(MediaRouter.RouteInfo.PLAYBACK_TYPE_REMOTE)
.setVolumeHandling(MediaRouter.RouteInfo.PLAYBACK_VOLUME_FIXED)
.setVolume(VOLUME_MAX)
@@ -132,8 +132,8 @@
MediaRouteDescriptor routeDescriptor2 = new MediaRouteDescriptor.Builder(
VARIABLE_VOLUME_ROUTE_ID,
r.getString(R.string.variable_volume_route_name))
+ .setDescription(r.getString(R.string.sample_route_description))
.addControlFilters(CONTROL_FILTERS)
- .setIconResource(R.drawable.media_route_icon)
.setPlaybackType(MediaRouter.RouteInfo.PLAYBACK_TYPE_REMOTE)
.setVolumeHandling(MediaRouter.RouteInfo.PLAYBACK_VOLUME_VARIABLE)
.setVolumeMax(VOLUME_MAX)
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouterActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouterActivity.java
index a27e46d..1acecc5 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouterActivity.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouterActivity.java
@@ -127,7 +127,7 @@
// Listen for changes to media routes.
mMediaRouter.addCallback(mSelector, mCallback,
MediaRouter.CALLBACK_FLAG_UNFILTERED_EVENTS);
- updateRouteStatus();
+ updateRouteDescription();
}
@Override
@@ -156,11 +156,11 @@
return true;
}
- private void updateRouteStatus() {
+ private void updateRouteDescription() {
RouteInfo route = mMediaRouter.getSelectedRoute();
mInfoTextView.setText("Currently selected route: " + route.getName()
+ " from provider " + route.getProvider().getPackageName()
- + ", status: " + route.getStatus());
+ + ", description: " + route.getDescription());
updateButtons();
}
@@ -293,7 +293,7 @@
@Override
public void onRouteChanged(MediaRouter router, RouteInfo route) {
Log.d(TAG, "onRouteChanged: route=" + route);
- updateRouteStatus();
+ updateRouteDescription();
}
@Override
@@ -304,13 +304,13 @@
@Override
public void onRouteSelected(MediaRouter router, RouteInfo route) {
Log.d(TAG, "onRouteSelected: route=" + route);
- updateRouteStatus();
+ updateRouteDescription();
}
@Override
public void onRouteUnselected(MediaRouter router, RouteInfo route) {
Log.d(TAG, "onRouteUnselected: route=" + route);
- updateRouteStatus();
+ updateRouteDescription();
}
@Override