diff options
author | Adam Powell <adamp@google.com> | 2012-10-10 15:37:47 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2012-10-10 15:39:59 -0700 |
commit | 3f369684e13dfea0ba8ea134f3e95930b0dd7df0 (patch) | |
tree | bf458ef227c89aa94b75c0d67a7722a50c589b73 /media/java | |
parent | 251445667ce045c4425c10fb24e3e23f90a210c0 (diff) | |
download | frameworks_base-3f369684e13dfea0ba8ea134f3e95930b0dd7df0.zip frameworks_base-3f369684e13dfea0ba8ea134f3e95930b0dd7df0.tar.gz frameworks_base-3f369684e13dfea0ba8ea134f3e95930b0dd7df0.tar.bz2 |
Fix MediaRouter prioritization around a2dp devices
Most recently connected audio output gets priority. Wifi display will
dominate over everything.
Bug 7324334
Change-Id: I29b59570a2e9b5352be436dc5b7a0a6861dfae6b
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); } |