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

Commit 8397173a 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:...

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

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

Change-Id: I31fec0a7e983e29a040980360bd63e29496d58a6
parents 90e24630 ca2e42f5
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() {