diff options
author | hychao <hychao@chromium.org> | 2015-06-29 20:38:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-30 03:39:12 +0000 |
commit | 087ec22e33df67073e3874aa6de0b0fbbf6b8101 (patch) | |
tree | 9b98eb2be73189e1777d3f77b2b30e23a737eade | |
parent | 7513fa5b66fd3a2fbd310fa8735e14449f52c618 (diff) | |
download | chromium_src-087ec22e33df67073e3874aa6de0b0fbbf6b8101.zip chromium_src-087ec22e33df67073e3874aa6de0b0fbbf6b8101.tar.gz chromium_src-087ec22e33df67073e3874aa6de0b0fbbf6b8101.tar.bz2 |
Lower the audio device priority for bluetooth mic
BUG=495537
Review URL: https://codereview.chromium.org/1211773002
Cr-Commit-Position: refs/heads/master@{#336724}
-rw-r--r-- | chromeos/audio/audio_device.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc index 32012a1..fd6ae45 100644 --- a/chromeos/audio/audio_device.cc +++ b/chromeos/audio/audio_device.cc @@ -15,7 +15,12 @@ namespace { // Get the priority for a particular device type. The priority returned // will be between 0 to 3, the higher number meaning a higher priority. -uint8 GetDevicePriority(AudioDeviceType type) { +uint8 GetDevicePriority(AudioDeviceType type, bool is_input) { + // Lower the priority of bluetooth mic to prevent unexpected bad eperience + // to user because of bluetooth audio profile switching. Make priority to + // zero so this mic will never be automatically chosen. + if (type == AUDIO_TYPE_BLUETOOTH && is_input) + return 0; switch (type) { case AUDIO_TYPE_HEADPHONE: case AUDIO_TYPE_MIC: @@ -118,7 +123,7 @@ AudioDevice::AudioDevice(const AudioNode& node) { else display_name = node.device_name; device_name = node.device_name; - priority = GetDevicePriority(type); + priority = GetDevicePriority(type, node.is_input); active = node.active; plugged_time = node.plugged_time; } |