summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-19 01:18:53 +0000
committerjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-19 01:18:53 +0000
commit7949fb7d74d03196c7e08437ad8806703ed93b20 (patch)
tree6c82975b17d9a01c8c7cf9afb1c9824484d46384 /chromeos
parent82fc7d94f6757c19f7f08adb131456c8e17cc0b5 (diff)
downloadchromium_src-7949fb7d74d03196c7e08437ad8806703ed93b20.zip
chromium_src-7949fb7d74d03196c7e08437ad8806703ed93b20.tar.gz
chromium_src-7949fb7d74d03196c7e08437ad8806703ed93b20.tar.bz2
Add log for recording calls for setting audio input mute/unmute.
BUG=364921 Review URL: https://codereview.chromium.org/243523004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/audio/cras_audio_handler.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
index fd2d92e..f834b0c 100644
--- a/chromeos/audio/cras_audio_handler.cc
+++ b/chromeos/audio/cras_audio_handler.cc
@@ -243,11 +243,13 @@ void CrasAudioHandler::SetInputMute(bool mute_on) {
if (!SetInputMuteInternal(mute_on))
return;
+ LOG(WARNING) << "SetInputMute set active input id="
+ << "0x" << std::hex << active_input_node_id_
+ << " mute=" << mute_on;
AudioDevice device;
if (const AudioDevice* device = GetDeviceFromId(active_input_node_id_))
audio_pref_handler_->SetMuteValue(*device, input_mute_on_);
-
FOR_EACH_OBSERVER(AudioObserver, observers_, OnInputMuteChanged());
}
@@ -288,13 +290,20 @@ void CrasAudioHandler::SetMuteForDevice(uint64 device_id, bool mute_on) {
SetOutputMute(mute_on);
return;
} else if (device_id == active_input_node_id_) {
+ LOG(WARNING) << "SetMuteForDevice sets active input device id="
+ << "0x" << std::hex << device_id << " mute=" << mute_on;
SetInputMute(mute_on);
return;
}
AudioDevice device;
- if (const AudioDevice* device = GetDeviceFromId(device_id))
+ if (const AudioDevice* device = GetDeviceFromId(device_id)) {
+ if (device->is_input) {
+ LOG(WARNING) << "SetMuteForDevice set mute pref for input device id="
+ << "0x" << std::hex << device_id << " mute=" << mute_on;
+ }
audio_pref_handler_->SetMuteValue(*device, mute_on);
+ }
}
void CrasAudioHandler::LogErrors() {
@@ -416,6 +425,8 @@ void CrasAudioHandler::SetupAudioInputState() {
}
input_mute_on_ = audio_pref_handler_->GetMuteValue(*device);
input_gain_ = audio_pref_handler_->GetInputGainValue(device);
+ LOG(WARNING) << "SetupAudioInputState from pref input device id="
+ << "0x" << std::hex << device->id << " mute=" << input_mute_on_;
SetInputMuteInternal(input_mute_on_);
// TODO(rkc,jennyz): Set input gain once we decide on how to store
// the gain values since the range and step are both device specific.
@@ -458,9 +469,15 @@ void CrasAudioHandler::ApplyAudioPolicy() {
if (audio_pref_handler_->GetAudioCaptureAllowedValue()) {
// Set input mute if we have discovered active input device.
const AudioDevice* device = GetDeviceFromId(active_input_node_id_);
- if (device)
+ if (device) {
+ LOG(WARNING) << "Audio input allowed by policy, sets input id="
+ << "0x" << std::hex << active_input_node_id_
+ << " mute=false";
SetInputMuteInternal(false);
+ }
} else {
+ LOG(WARNING) << "Audio input NOT allowed by policy, sets input id="
+ << "0x" << std::hex << active_input_node_id_ << " mute=true";
SetInputMute(true);
input_mute_locked_ = true;
}
@@ -490,6 +507,9 @@ bool CrasAudioHandler::SetInputMuteInternal(bool mute_on) {
if (input_mute_locked_)
return false;
+ LOG(WARNING) << "SetInputMuteInternal sets active input device id="
+ << "0x" << std::hex << active_input_node_id_
+ << " mute=" << mute_on;
input_mute_on_ = mute_on;
chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
SetInputMute(mute_on);