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

Commit fb901079 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix MediaRouter prioritization around a2dp devices" into jb-mr1-dev

parents 6b17799b 3f369684
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ public class MediaRouter {
                dispatchRouteChanged(sStatic.mDefaultAudioVideo);
            }

            final int mainType = mCurAudioRoutesInfo.mMainType;

            boolean a2dpEnabled;
            try {
                a2dpEnabled = mAudioService.isBluetoothA2dpOn();
@@ -180,11 +182,10 @@ public class MediaRouter {
            }

            if (mBluetoothA2dpRoute != null) {
                if (mCurAudioRoutesInfo.mMainType != AudioRoutesInfo.MAIN_SPEAKER &&
                        mSelectedRoute == mBluetoothA2dpRoute) {
                if (mainType != AudioRoutesInfo.MAIN_SPEAKER &&
                        mSelectedRoute == mBluetoothA2dpRoute && !a2dpEnabled) {
                    selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO, mDefaultAudioVideo);
                } else if (mCurAudioRoutesInfo.mMainType == AudioRoutesInfo.MAIN_SPEAKER &&
                        (mSelectedRoute == mDefaultAudioVideo || mSelectedRoute == null) &&
                } else if ((mSelectedRoute == mDefaultAudioVideo || mSelectedRoute == null) &&
                        a2dpEnabled) {
                    selectRouteStatic(ROUTE_TYPE_LIVE_AUDIO, mBluetoothA2dpRoute);
                }