diff options
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 5 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index a71aa53..3fe0547 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -4584,7 +4584,7 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER; if (device) break; } - if (mPhoneState != AUDIO_MODE_IN_CALL) { + if (!isInCall()) { device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_ACCESSORY; if (device) break; device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_DEVICE; @@ -5145,6 +5145,9 @@ audio_devices_t AudioPolicyManager::getDeviceForInputSource(audio_source_t input case AUDIO_SOURCE_MIC: if (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_A2DP) { device = AUDIO_DEVICE_IN_BLUETOOTH_A2DP; + } else if ((mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] == AUDIO_POLICY_FORCE_BT_SCO) && + (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET)) { + device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET; } else if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) { device = AUDIO_DEVICE_IN_WIRED_HEADSET; } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) { diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h index 4c976a3..2059f58 100644 --- a/services/audiopolicy/AudioPolicyManager.h +++ b/services/audiopolicy/AudioPolicyManager.h @@ -763,9 +763,9 @@ protected: bool isNonOffloadableEffectEnabled(); - status_t addAudioPatch(audio_patch_handle_t handle, + virtual status_t addAudioPatch(audio_patch_handle_t handle, const sp<AudioPatch>& patch); - status_t removeAudioPatch(audio_patch_handle_t handle); + virtual status_t removeAudioPatch(audio_patch_handle_t handle); sp<AudioOutputDescriptor> getOutputFromId(audio_port_handle_t id) const; sp<AudioInputDescriptor> getInputFromId(audio_port_handle_t id) const; |