From bd23674643e0993e443ef785e80b9ad2e3e9adf4 Mon Sep 17 00:00:00 2001 From: jennyz Date: Wed, 2 Mar 2016 12:15:52 -0800 Subject: Persist the user's active audio device choice across chromeos session and reboots. This cl added a new attribute to device's active state settings to describe if the device is made active by user's selection or by automatic priority selection. The device made active by user has a higher priority than the device made active by priority. With the stable device id, the active device selection rule is different than before, which only select the active device by its priority. Please see the details in the following document. https://docs.google.com/a/google.com/document/d/1zmSeM956Njh_9ZdLqyld-NTOpJyXVIfzv8DvQ1Xcksw/edit?usp=sharing BUG=308143 TBR=stevenjb,rkc,derat Review URL: https://codereview.chromium.org/1746843002 Cr-Commit-Position: refs/heads/master@{#378812} --- extensions/shell/browser/shell_audio_controller_chromeos.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'extensions/shell') diff --git a/extensions/shell/browser/shell_audio_controller_chromeos.cc b/extensions/shell/browser/shell_audio_controller_chromeos.cc index 19e34ce2..1e89065 100644 --- a/extensions/shell/browser/shell_audio_controller_chromeos.cc +++ b/extensions/shell/browser/shell_audio_controller_chromeos.cc @@ -78,13 +78,15 @@ void ShellAudioController::ActivateDevices() { const chromeos::AudioDevice* device = GetDevice(devices, best_input); DCHECK(device); VLOG(1) << "Activating input device: " << device->ToString(); - handler->SwitchToDevice(*device, true); + handler->SwitchToDevice(*device, true, + chromeos::CrasAudioHandler::ACTIVATE_BY_USER); } if (best_output && best_output != handler->GetPrimaryActiveOutputNode()) { const chromeos::AudioDevice* device = GetDevice(devices, best_output); DCHECK(device); VLOG(1) << "Activating output device: " << device->ToString(); - handler->SwitchToDevice(*device, true); + handler->SwitchToDevice(*device, true, + chromeos::CrasAudioHandler::ACTIVATE_BY_USER); } } -- cgit v1.1