diff options
author | Adam Powell <adamp@google.com> | 2012-10-10 16:28:29 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-10 16:28:29 -0700 |
commit | fb9010798d9352fd4f9413f882ffd214d69610b5 (patch) | |
tree | 075a3afc9c409ece042cc46a1a240dc03f18b9ed /media/java | |
parent | 6b17799b253dad55dc3df7929342d7effa3137ea (diff) | |
parent | 3f369684e13dfea0ba8ea134f3e95930b0dd7df0 (diff) | |
download | frameworks_base-fb9010798d9352fd4f9413f882ffd214d69610b5.zip frameworks_base-fb9010798d9352fd4f9413f882ffd214d69610b5.tar.gz frameworks_base-fb9010798d9352fd4f9413f882ffd214d69610b5.tar.bz2 |
Merge "Fix MediaRouter prioritization around a2dp devices" into jb-mr1-dev
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/MediaRouter.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/media/java/android/media/MediaRouter.java b/media/java/android/media/MediaRouter.java index 16ad74f..8e9384ee 100644 --- a/media/java/android/media/MediaRouter.java +++ b/media/java/android/media/MediaRouter.java @@ -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); } |