| Index: chromeos/audio/cras_audio_handler.cc
|
| diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
|
| index 64e4271b3d1bb3c714861f07f9ffaf90c4fa383f..5f95db5939208864af4745c25cd51856dc545266 100644
|
| --- a/chromeos/audio/cras_audio_handler.cc
|
| +++ b/chromeos/audio/cras_audio_handler.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/bind_helpers.h"
|
| #include "base/logging.h"
|
| #include "base/sys_info.h"
|
| +#include "base/system_monitor/system_monitor.h"
|
| #include "chromeos/audio/audio_devices_pref_handler_stub.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
|
|
| @@ -1242,6 +1243,18 @@ void CrasAudioHandler::HandleAudioDeviceChange(
|
| // Typical user hotplug case.
|
| HandleHotPlugDevice(hotplug_nodes.top(), devices_pq);
|
| }
|
| +
|
| + // content::MediaStreamManager listens to
|
| + // base::SystemMonitor::DevicesChangedObserver for audio capture devices,
|
| + // and updates EnumerateDevices when OnDevicesChanged is called.
|
| + if (is_input) {
|
| + base::SystemMonitor* monitor = base::SystemMonitor::Get();
|
| + // In some unittest, |monitor| might be nullptr.
|
| + if (!monitor)
|
| + return;
|
| + monitor->ProcessDevicesChanged(
|
| + base::SystemMonitor::DeviceType::DEVTYPE_AUDIO_CAPTURE);
|
| + }
|
| }
|
|
|
| void CrasAudioHandler::HandleGetNodes(const chromeos::AudioNodeList& node_list,
|
|
|