| Index: content/child/child_thread_impl.cc
|
| diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
|
| index 29454b64e1ab12feba98ce80e1d88bb66093b504..9bb1486e04317f5f283fa9ccf4665b159b208526 100644
|
| --- a/content/child/child_thread_impl.cc
|
| +++ b/content/child/child_thread_impl.cc
|
| @@ -777,10 +777,17 @@ bool ChildThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
|
| }
|
|
|
| void ChildThreadImpl::OnProcessBackgrounded(bool backgrounded) {
|
| + LOG(ERROR) << __func__ << " : " << backgrounded;
|
| // Set timer slack to maximum on main thread when in background.
|
| base::TimerSlack timer_slack = base::TIMER_SLACK_NONE;
|
| if (backgrounded)
|
| timer_slack = base::TIMER_SLACK_MAXIMUM;
|
| +#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(!backgrounded);
|
| +#endif
|
| +
|
| base::MessageLoop::current()->SetTimerSlack(timer_slack);
|
| }
|
|
|
|
|