| Index: chrome/browser/chromeos/policy/device_status_collector.cc
|
| diff --git a/chrome/browser/chromeos/policy/device_status_collector.cc b/chrome/browser/chromeos/policy/device_status_collector.cc
|
| index 06a4c76a7ce5217da056ec226e24a643977e3d94..e78f49766e8d9945771018541a34611e53b51217 100644
|
| --- a/chrome/browser/chromeos/policy/device_status_collector.cc
|
| +++ b/chrome/browser/chromeos/policy/device_status_collector.cc
|
| @@ -43,6 +43,7 @@
|
| #include "chrome/browser/policy/profile_policy_connector_factory.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/common/pref_names.h"
|
| +#include "chromeos/audio/cras_audio_handler.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "chromeos/dbus/update_engine_client.h"
|
| #include "chromeos/disks/disk_mount_manager.h"
|
| @@ -485,6 +486,8 @@ DeviceStatusCollector::DeviceStatusCollector(
|
| chromeos::kReportOsUpdateStatus, callback);
|
| running_kiosk_app_subscription_ = cros_settings_->AddSettingsObserver(
|
| chromeos::kReportRunningKioskApp, callback);
|
| + sound_volume_subscription_ = cros_settings_->AddSettingsObserver(
|
| + chromeos::kReportSoundVolume, callback);
|
|
|
| // Fetch the current values of the policies.
|
| UpdateReportingSettings();
|
| @@ -558,6 +561,10 @@ void DeviceStatusCollector::UpdateReportingSettings() {
|
| chromeos::kReportDeviceUsers, &report_users_)) {
|
| report_users_ = true;
|
| }
|
| + if (!cros_settings_->GetBoolean(
|
| + chromeos::kReportSoundVolume, &report_sound_volume_)) {
|
| + report_sound_volume_ = true;
|
| + }
|
|
|
| const bool already_reporting_hardware_status = report_hardware_status_;
|
| if (!cros_settings_->GetBoolean(
|
| @@ -1079,6 +1086,13 @@ bool DeviceStatusCollector::GetRunningKioskApp(
|
| return true;
|
| }
|
|
|
| +bool DeviceStatusCollector::GetSoundVolume(
|
| + em::DeviceStatusReportRequest* status) {
|
| + chromeos::CrasAudioHandler* audio_handler = chromeos::CrasAudioHandler::Get();
|
| + status->set_sound_volume(audio_handler->GetOutputVolumePercent());
|
| + return true;
|
| +}
|
| +
|
| void DeviceStatusCollector::GetDeviceAndSessionStatusAsync(
|
| const StatusCallback& response) {
|
| // Must be on creation thread since some stats are written to in that thread
|
| @@ -1131,6 +1145,9 @@ void DeviceStatusCollector::GetDeviceStatus(
|
| if (report_running_kiosk_app_)
|
| anything_reported |= GetRunningKioskApp(status);
|
|
|
| + if (report_sound_volume_)
|
| + anything_reported |= GetSoundVolume(status);
|
| +
|
| // Wipe pointer if we didn't actually add any data.
|
| if (!anything_reported)
|
| state->ResetDeviceStatus();
|
|
|