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

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

Merge "Prevent unnecessary call of setBluetoothA2dpOn(false)" into rvc-dev am: 7bfb0c31

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

Change-Id: Ia56961f82b2d889a3d3ba129bd4fbae8374f6363
parents 2478e17a 7bfb0c31
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -221,12 +221,11 @@ public class MediaRouter {

            if (!TextUtils.equals(newRoutes.bluetoothName, mCurAudioRoutesInfo.bluetoothName)) {
                forceUseDefaultRoute = false;
                mCurAudioRoutesInfo.bluetoothName = newRoutes.bluetoothName;
                if (mCurAudioRoutesInfo.bluetoothName != null) {
                if (newRoutes.bluetoothName != null) {
                    if (mBluetoothA2dpRoute == null) {
                        // BT connected
                        final RouteInfo info = new RouteInfo(mSystemCategory);
                        info.mName = mCurAudioRoutesInfo.bluetoothName;
                        info.mName = newRoutes.bluetoothName;
                        info.mDescription = mResources.getText(
                                com.android.internal.R.string.bluetooth_a2dp_audio_route_name);
                        info.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO;
@@ -234,13 +233,14 @@ public class MediaRouter {
                        mBluetoothA2dpRoute = info;
                        addRouteStatic(mBluetoothA2dpRoute);
                    } else {
                        mBluetoothA2dpRoute.mName = mCurAudioRoutesInfo.bluetoothName;
                        mBluetoothA2dpRoute.mName = newRoutes.bluetoothName;
                        dispatchRouteChanged(mBluetoothA2dpRoute);
                    }
                } else if (mBluetoothA2dpRoute != null) {
                    // BT disconnected
                    removeRouteStatic(mBluetoothA2dpRoute);
                    RouteInfo btRoute = mBluetoothA2dpRoute;
                    mBluetoothA2dpRoute = null;
                    removeRouteStatic(btRoute);
                }
                audioRoutesChanged = true;
            }
@@ -256,6 +256,7 @@ public class MediaRouter {
                    }
                }
            }
            mCurAudioRoutesInfo.bluetoothName = newRoutes.bluetoothName;
        }

        boolean isBluetoothA2dpOn() {