Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b5c371c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Revert "Call route selected/unselected callbacks"" into sc-qpr1-dev

parents f3e37390 ef07a1a4
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -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);
                    } else if (mSelectedRoute.isBluetooth() && !a2dpOn) {
                        setSelectedRoute(mDefaultAudioVideo, /*explicit=*/false);
                        dispatchRouteUnselected(ROUTE_TYPE_LIVE_AUDIO, mBluetoothA2dpRoute);
                        dispatchRouteSelected(ROUTE_TYPE_LIVE_AUDIO, mDefaultAudioVideo);
                    }
                });
            }
@@ -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);