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

Commit a13318f3 authored by Sungsoo Lim's avatar Sungsoo Lim Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: Revert "Call route selected/unselected callbacks" am: ef07a1a4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15884590

Change-Id: Ied840ecfafa414e2792cdc00317e28f4264a4636
parents 7f32de30 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);