| Index: content/browser/renderer_host/render_process_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
| index 8132d91881c06d0bebedbc1b19d224585844c198..b0dc6a4872528ae75d10cdf972c4eb4a728dcc6e 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -30,6 +30,7 @@
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/metrics/persistent_histogram_allocator.h"
|
| #include "base/metrics/persistent_memory_allocator.h"
|
| +#include "base/power_monitor/power_monitor.h"
|
| #include "base/process/process_handle.h"
|
| #include "base/rand_util.h"
|
| #include "base/single_thread_task_runner.h"
|
| @@ -1438,6 +1439,7 @@ int RenderProcessHostImpl::VisibleWidgetCount() const {
|
| }
|
|
|
| void RenderProcessHostImpl::AudioStateChanged() {
|
| + LOG(ERROR) << __func__;
|
| UpdateProcessPriority();
|
| }
|
|
|
| @@ -2752,6 +2754,12 @@ void RenderProcessHostImpl::UpdateProcessPriority() {
|
| // (http://crbug.com/398103).
|
| child_process_launcher_->SetProcessBackgrounded(should_background);
|
|
|
| +#if defined(OS_ANDROID)
|
| + // Defer suspend events on Android if the scheduler says so; this ensures that
|
| + // functionality like background audio playback works properly.
|
| + base::PowerMonitor::Get()->DeferSuspendEvents(!should_background);
|
| +#endif
|
| +
|
| // Notify the child process of background state.
|
| Send(new ChildProcessMsg_SetProcessBackgrounded(should_background));
|
| }
|
|
|