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

Commit 65a5d03b authored by Sungsoo Lim's avatar Sungsoo Lim Committed by android-build-merger
Browse files

Merge "Select a system audio route only when needed" into oc-mr1-dev am: d4aee713

am: cf874bbe

Change-Id: I79a44736931cea34eb6d00a62ae33b569021e9e4
parents 38d1b779 cf874bbe
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -204,7 +204,6 @@ public class MediaRouter {
                audioRoutesChanged = true;
                audioRoutesChanged = true;
            }
            }


            final int mainType = mCurAudioRoutesInfo.mainType;
            if (!TextUtils.equals(newRoutes.bluetoothName, mCurAudioRoutesInfo.bluetoothName)) {
            if (!TextUtils.equals(newRoutes.bluetoothName, mCurAudioRoutesInfo.bluetoothName)) {
                mCurAudioRoutesInfo.bluetoothName = newRoutes.bluetoothName;
                mCurAudioRoutesInfo.bluetoothName = newRoutes.bluetoothName;
                if (mCurAudioRoutesInfo.bluetoothName != null) {
                if (mCurAudioRoutesInfo.bluetoothName != null) {
@@ -231,8 +230,11 @@ public class MediaRouter {
            }
            }


            if (audioRoutesChanged) {
            if (audioRoutesChanged) {
                selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO, getDefaultSystemAudioRoute(), false);
                Log.v(TAG, "Audio routes updated: " + newRoutes + ", a2dp=" + isBluetoothA2dpOn());
                Log.v(TAG, "Audio routes updated: " + newRoutes + ", a2dp=" + isBluetoothA2dpOn());
                if (mSelectedRoute == null || mSelectedRoute == mDefaultAudioVideo
                        || mSelectedRoute == mBluetoothA2dpRoute) {
                    selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO, getDefaultSystemAudioRoute(), false);
                }
            }
            }
        }
        }