Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: chromeos/audio/audio_device.cc

Issue 1211773002: Lower the audio device priority for bluetooth mic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/audio_device.cc
diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc
index 32012a12aa5166341069b88ee3e0efaece5a77f4..fd6ae45e42d878958b8a746ee7f6c90bcf6cf119 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698