DO NOT MERGE: Revert "Call route selected/unselected callbacks"
This reverts commit6adeb2c9f1. Bug: 193831720, Bug: 168093983 Test: manual Change-Id: I0c0c3ac9ed63bafe419c8a127772d4042abbab89 (cherry picked from commit89d28318a0)
This commit is contained in:
@@ -696,17 +696,13 @@ public class MediaRouter {
|
||||
@Override
|
||||
public void onGlobalA2dpChanged(boolean a2dpOn) {
|
||||
mHandler.post(() -> {
|
||||
if (mSelectedRoute == null || mBluetoothA2dpRoute == null) {
|
||||
if (mSelectedRoute == null) {
|
||||
return;
|
||||
}
|
||||
if (mSelectedRoute.isDefault() && a2dpOn) {
|
||||
setSelectedRoute(mBluetoothA2dpRoute, /*explicit=*/ false);
|
||||
dispatchRouteUnselected(ROUTE_TYPE_LIVE_AUDIO, mDefaultAudioVideo);
|
||||
dispatchRouteSelected(ROUTE_TYPE_LIVE_AUDIO, mBluetoothA2dpRoute);
|
||||
setSelectedRoute(mBluetoothA2dpRoute, /*explicit=*/false);
|
||||
} else if (mSelectedRoute.isBluetooth() && !a2dpOn) {
|
||||
setSelectedRoute(mDefaultAudioVideo, /*explicit=*/ false);
|
||||
dispatchRouteUnselected(ROUTE_TYPE_LIVE_AUDIO, mBluetoothA2dpRoute);
|
||||
dispatchRouteSelected(ROUTE_TYPE_LIVE_AUDIO, mDefaultAudioVideo);
|
||||
setSelectedRoute(mDefaultAudioVideo, /*explicit=*/false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1367,9 +1363,6 @@ public class MediaRouter {
|
||||
}
|
||||
|
||||
static void dispatchRouteSelected(int type, RouteInfo info) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Dispatching route selected: " + info);
|
||||
}
|
||||
for (CallbackInfo cbi : sStatic.mCallbacks) {
|
||||
if (cbi.filterRouteEvent(info)) {
|
||||
cbi.cb.onRouteSelected(cbi.router, type, info);
|
||||
@@ -1378,9 +1371,6 @@ public class MediaRouter {
|
||||
}
|
||||
|
||||
static void dispatchRouteUnselected(int type, RouteInfo info) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Dispatching route unselected: " + info);
|
||||
}
|
||||
for (CallbackInfo cbi : sStatic.mCallbacks) {
|
||||
if (cbi.filterRouteEvent(info)) {
|
||||
cbi.cb.onRouteUnselected(cbi.router, type, info);
|
||||
|
||||
Reference in New Issue
Block a user