Loading media/java/android/media/AudioRoutesInfo.java +17 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,23 @@ public class AudioRoutesInfo implements Parcelable { return 0; } @Override public String toString() { return getClass().getSimpleName() + "{ type=" + typeToString(mainType) + (TextUtils.isEmpty(bluetoothName) ? "" : ", bluetoothName=" + bluetoothName) + " }"; } private static String typeToString(int type) { if (type == MAIN_SPEAKER) return "SPEAKER"; if ((type & MAIN_HEADSET) != 0) return "HEADSET"; if ((type & MAIN_HEADPHONES) != 0) return "HEADPHONES"; if ((type & MAIN_DOCK_SPEAKERS) != 0) return "DOCK_SPEAKERS"; if ((type & MAIN_HDMI) != 0) return "HDMI"; if ((type & MAIN_USB) != 0) return "USB"; return Integer.toHexString(type); } @Override public void writeToParcel(Parcel dest, int flags) { TextUtils.writeToParcel(bluetoothName, dest, flags); Loading media/java/android/media/MediaRouter.java +5 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ public class MediaRouter { } void updateAudioRoutes(AudioRoutesInfo newRoutes) { Log.v(TAG, "Updating audio routes: " + newRoutes); if (newRoutes.mainType != mCurAudioRoutesInfo.mainType) { mCurAudioRoutesInfo.mainType = newRoutes.mainType; int name; Loading Loading @@ -905,6 +906,7 @@ public class MediaRouter { } static void selectRouteStatic(int types, @NonNull RouteInfo route, boolean explicit) { Log.v(TAG, "Selecting route: " + route); assert(route != null); final RouteInfo oldRoute = sStatic.mSelectedRoute; if (oldRoute == route) return; Loading Loading @@ -1007,6 +1009,7 @@ public class MediaRouter { } static void addRouteStatic(RouteInfo info) { Log.v(TAG, "Adding route: " + info); final RouteCategory cat = info.getCategory(); if (!sStatic.mCategories.contains(cat)) { sStatic.mCategories.add(cat); Loading Loading @@ -1061,6 +1064,7 @@ public class MediaRouter { } static void removeRouteStatic(RouteInfo info) { Log.v(TAG, "Removing route: " + info); if (sStatic.mRoutes.remove(info)) { final RouteCategory removingCat = info.getCategory(); final int count = sStatic.mRoutes.size(); Loading Loading @@ -1210,6 +1214,7 @@ public class MediaRouter { } static void dispatchRouteChanged(RouteInfo info, int oldSupportedTypes) { Log.v(TAG, "Dispatching route change: " + info); final int newSupportedTypes = info.mSupportedTypes; for (CallbackInfo cbi : sStatic.mCallbacks) { // Reconstruct some of the history for callbacks that may not have observed Loading Loading
media/java/android/media/AudioRoutesInfo.java +17 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,23 @@ public class AudioRoutesInfo implements Parcelable { return 0; } @Override public String toString() { return getClass().getSimpleName() + "{ type=" + typeToString(mainType) + (TextUtils.isEmpty(bluetoothName) ? "" : ", bluetoothName=" + bluetoothName) + " }"; } private static String typeToString(int type) { if (type == MAIN_SPEAKER) return "SPEAKER"; if ((type & MAIN_HEADSET) != 0) return "HEADSET"; if ((type & MAIN_HEADPHONES) != 0) return "HEADPHONES"; if ((type & MAIN_DOCK_SPEAKERS) != 0) return "DOCK_SPEAKERS"; if ((type & MAIN_HDMI) != 0) return "HDMI"; if ((type & MAIN_USB) != 0) return "USB"; return Integer.toHexString(type); } @Override public void writeToParcel(Parcel dest, int flags) { TextUtils.writeToParcel(bluetoothName, dest, flags); Loading
media/java/android/media/MediaRouter.java +5 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ public class MediaRouter { } void updateAudioRoutes(AudioRoutesInfo newRoutes) { Log.v(TAG, "Updating audio routes: " + newRoutes); if (newRoutes.mainType != mCurAudioRoutesInfo.mainType) { mCurAudioRoutesInfo.mainType = newRoutes.mainType; int name; Loading Loading @@ -905,6 +906,7 @@ public class MediaRouter { } static void selectRouteStatic(int types, @NonNull RouteInfo route, boolean explicit) { Log.v(TAG, "Selecting route: " + route); assert(route != null); final RouteInfo oldRoute = sStatic.mSelectedRoute; if (oldRoute == route) return; Loading Loading @@ -1007,6 +1009,7 @@ public class MediaRouter { } static void addRouteStatic(RouteInfo info) { Log.v(TAG, "Adding route: " + info); final RouteCategory cat = info.getCategory(); if (!sStatic.mCategories.contains(cat)) { sStatic.mCategories.add(cat); Loading Loading @@ -1061,6 +1064,7 @@ public class MediaRouter { } static void removeRouteStatic(RouteInfo info) { Log.v(TAG, "Removing route: " + info); if (sStatic.mRoutes.remove(info)) { final RouteCategory removingCat = info.getCategory(); final int count = sStatic.mRoutes.size(); Loading Loading @@ -1210,6 +1214,7 @@ public class MediaRouter { } static void dispatchRouteChanged(RouteInfo info, int oldSupportedTypes) { Log.v(TAG, "Dispatching route change: " + info); final int newSupportedTypes = info.mSupportedTypes; for (CallbackInfo cbi : sStatic.mCallbacks) { // Reconstruct some of the history for callbacks that may not have observed Loading