Merge "Select a system audio route only when needed" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d4aee713d4
@@ -202,7 +202,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) {
|
||||||
@@ -229,8 +228,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user