Skip to content
Snippets Groups Projects
Commit 013255d7 authored by Pavan Koushik Nellore's avatar Pavan Koushik Nellore Committed by Adrien Béraud
Browse files

fix Bluetooth routing condition

update the logic to check isBluetoothScoOn instead,
which more accurately reflects whether Bluetooth SCO
audio is active and available for routing.

Change-Id: I9d47876fd0440a38d2235da9dc8a24439b898c23
parent 2ae7e6d3
Branches
Tags android/release_456
No related merge requests found
...@@ -270,8 +270,8 @@ class HardwareServiceImpl( ...@@ -270,8 +270,8 @@ class HardwareServiceImpl(
private fun setAudioRouting(requestSpeakerOn: Boolean) { private fun setAudioRouting(requestSpeakerOn: Boolean) {
// prioritize bluetooth by checking for bluetooth device first // prioritize bluetooth by checking for bluetooth device first
val bt = mBluetoothWrapper val bt = mBluetoothWrapper
Log.w(TAG, "setAudioRouting requestSpeakerOn:$requestSpeakerOn isBTHeadsetConnected:${bt?.isBTHeadsetConnected} isWiredHeadsetOn:${mAudioManager.isWiredHeadsetOn}") Log.w(TAG, "setAudioRouting requestSpeakerOn:$requestSpeakerOn isBluetoothScoOn:${mAudioManager.isBluetoothScoOn} isWiredHeadsetOn:${mAudioManager.isWiredHeadsetOn}")
if (bt != null && bt.canBluetooth() && bt.isBTHeadsetConnected) { if (bt != null && bt.canBluetooth() && mAudioManager.isBluetoothScoOn) {
routeToBTHeadset() routeToBTHeadset()
} else if (!mAudioManager.isWiredHeadsetOn && mHasSpeakerPhone && requestSpeakerOn) { } else if (!mAudioManager.isWiredHeadsetOn && mHasSpeakerPhone && requestSpeakerOn) {
routeToSpeaker() routeToSpeaker()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment