summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-01 00:18:23 +0000
committerjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-01 00:18:23 +0000
commit934e3c950dad11ddc4198005ea2bc5ec6df3a5ec (patch)
tree3464d1eb729f5f34e0c4533d2b17ec75357a6dbc /chromeos
parent6b471f2f47106e5bdcbc5fd4c93d16c2715ac9d7 (diff)
downloadchromium_src-934e3c950dad11ddc4198005ea2bc5ec6df3a5ec.zip
chromium_src-934e3c950dad11ddc4198005ea2bc5ec6df3a5ec.tar.gz
chromium_src-934e3c950dad11ddc4198005ea2bc5ec6df3a5ec.tar.bz2
Remove old audio handler code.
Migrate the test cases to use CrasAudioHandler. Re-enabled PolicyTest.DisableAudioOutput, and fixed an issue found with this test case. BUG=233310 TBR=derat@chromium.org, rkc@chromium.org Review URL: https://codereview.chromium.org/21380002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214877 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/audio/cras_audio_handler.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
index f6ae05a..c6d92ec 100644
--- a/chromeos/audio/cras_audio_handler.cc
+++ b/chromeos/audio/cras_audio_handler.cc
@@ -399,8 +399,8 @@ void CrasAudioHandler::SetupAudioInputState() {
void CrasAudioHandler::SetupAudioOutputState() {
const AudioDevice* device = GetDeviceFromId(active_output_node_id_);
if (!device) {
- LOG(ERROR) << "Can't set up audio state for unknow output device id ="
- << "0x" << std::hex << active_output_node_id_;
+ LOG(ERROR) << "Can't set up audio state for unknow output device id ="
+ << "0x" << std::hex << active_output_node_id_;
return;
}
output_mute_on_ = audio_pref_handler_->GetMuteValue(*device);
@@ -417,8 +417,14 @@ void CrasAudioHandler::InitializeAudioState() {
void CrasAudioHandler::ApplyAudioPolicy() {
output_mute_locked_ = false;
if (!audio_pref_handler_->GetAudioOutputAllowedValue()) {
- SetOutputMute(true);
+ // Mute the device, but do not update the preference.
+ SetOutputMuteInternal(true);
output_mute_locked_ = true;
+ } else {
+ // Restore the mute state.
+ const AudioDevice* device = GetDeviceFromId(active_output_node_id_);
+ if (device)
+ SetOutputMuteInternal(audio_pref_handler_->GetMuteValue(*device));
}
input_mute_locked_ = false;