Select BT route when currently selected route becomes unavailable

Bug: 10003524
Change-Id: I5de740fac9f2bc2a56125296defe892a8deb505e
This commit is contained in:
Chong Zhang
2013-07-26 12:36:30 -07:00
parent a5bc070e9e
commit 2e5fbf5521

View File

@@ -654,7 +654,13 @@ public class MediaRouter {
if (info == sStatic.mSelectedRoute) {
// Removing the currently selected route? Select the default before we remove it.
// TODO: Be smarter about the route types here; this selects for all valid.
selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_USER, sStatic.mDefaultAudioVideo);
if (info != sStatic.mBluetoothA2dpRoute && sStatic.mBluetoothA2dpRoute != null) {
selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_USER,
sStatic.mBluetoothA2dpRoute);
} else {
selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_USER,
sStatic.mDefaultAudioVideo);
}
}
if (!found) {
sStatic.mCategories.remove(removingCat);