API updates for MediaRouter
* Accept a Context when fetching the names of routes and
categories. This lets string resources resolve at time of access
with the correct configuration. The older versions remain available
that will use the static resources from the application. (There are
enough cases where applications will populate this from external
data that requiring it each time even when it was not initialized
from a resource doesn't seem reasonable.)
* Remove the ability for apps to programmatically select non-user
routes.
* Make MediaRouter.Callback an abstract class instead of an interface.
This will make further extensions easier to keep compatible in the
future.
Change-Id: If981c511dfbdfaf41ef0d1cfe4a377fc14bb5600
diff --git a/api/16.txt b/api/16.txt
index c95de36..b8c1042 100644
--- a/api/16.txt
+++ b/api/16.txt
@@ -3679,6 +3679,7 @@
public class MediaRouteActionProvider extends android.view.ActionProvider {
ctor public MediaRouteActionProvider(android.content.Context);
method public android.view.View onCreateActionView();
+ method public void setExtendedSettingsClickListener(android.view.View.OnClickListener);
method public void setRouteTypes(int);
}
@@ -3687,7 +3688,9 @@
ctor public MediaRouteButton(android.content.Context, android.util.AttributeSet);
ctor public MediaRouteButton(android.content.Context, android.util.AttributeSet, int);
method public int getRouteTypes();
+ method public void setExtendedSettingsClickListener(android.view.View.OnClickListener);
method public void setRouteTypes(int);
+ method public void showDialog();
}
public class NativeActivity extends android.app.Activity implements android.view.InputQueue.Callback android.view.SurfaceHolder.Callback2 android.view.ViewTreeObserver.OnGlobalLayoutListener {
@@ -11511,6 +11514,7 @@
method public void addUserRoute(android.media.MediaRouter.UserRouteInfo);
method public void clearUserRoutes();
method public android.media.MediaRouter.RouteCategory createRouteCategory(java.lang.CharSequence, boolean);
+ method public android.media.MediaRouter.RouteCategory createRouteCategory(int, boolean);
method public android.media.MediaRouter.UserRouteInfo createUserRoute(android.media.MediaRouter.RouteCategory);
method public android.media.MediaRouter.RouteCategory getCategoryAt(int);
method public int getCategoryCount();
@@ -11524,7 +11528,8 @@
field public static final int ROUTE_TYPE_USER = 8388608; // 0x800000
}
- public static abstract interface MediaRouter.Callback {
+ public static abstract class MediaRouter.Callback {
+ ctor public MediaRouter.Callback();
method public abstract void onRouteAdded(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
method public abstract void onRouteChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
method public abstract void onRouteGrouped(android.media.MediaRouter, android.media.MediaRouter.RouteInfo, android.media.MediaRouter.RouteGroup, int);
@@ -11536,6 +11541,7 @@
public static class MediaRouter.RouteCategory {
method public java.lang.CharSequence getName();
+ method public java.lang.CharSequence getName(android.content.Context);
method public java.util.List<android.media.MediaRouter.RouteInfo> getRoutes(java.util.List<android.media.MediaRouter.RouteInfo>);
method public int getSupportedTypes();
method public boolean isGroupable();
@@ -11548,17 +11554,21 @@
method public int getRouteCount();
method public void removeRoute(android.media.MediaRouter.RouteInfo);
method public void removeRoute(int);
+ method public void setIconDrawable(android.graphics.drawable.Drawable);
+ method public void setIconResource(int);
}
public static class MediaRouter.RouteInfo {
method public android.media.MediaRouter.RouteCategory getCategory();
method public android.media.MediaRouter.RouteGroup getGroup();
+ method public android.graphics.drawable.Drawable getIconDrawable();
method public java.lang.CharSequence getName();
+ method public java.lang.CharSequence getName(android.content.Context);
method public java.lang.CharSequence getStatus();
method public int getSupportedTypes();
}
- public static class MediaRouter.SimpleCallback implements android.media.MediaRouter.Callback {
+ public static class MediaRouter.SimpleCallback extends android.media.MediaRouter.Callback {
ctor public MediaRouter.SimpleCallback();
method public void onRouteAdded(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
method public void onRouteChanged(android.media.MediaRouter, android.media.MediaRouter.RouteInfo);
@@ -11570,8 +11580,14 @@
}
public static class MediaRouter.UserRouteInfo extends android.media.MediaRouter.RouteInfo {
+ method public java.lang.Object getTag();
+ method public void setIconDrawable(android.graphics.drawable.Drawable);
+ method public void setIconResource(int);
method public void setName(java.lang.CharSequence);
+ method public void setName(int);
+ method public void setRemoteControlClient(android.media.RemoteControlClient);
method public void setStatus(java.lang.CharSequence);
+ method public void setTag(java.lang.Object);
}
public class MediaScannerConnection implements android.content.ServiceConnection {