OSDN Git Service

Hold a wake lock while DeviceIdleController is going idle.
authorJoe Onorato <joeo@google.com>
Fri, 9 Dec 2016 01:48:49 +0000 (17:48 -0800)
committerJulius D'souza <jdsouza@google.com>
Mon, 9 Jan 2017 21:37:53 +0000 (21:37 +0000)
commitb08db484c2bf254ef48415f6eeebc72c0f46a34a
tree427a135bfefb6941d1dcb143e21c7e472b3c942a
parent5df216f209c66afd337665189648e9a6a4102c66
Hold a wake lock while DeviceIdleController is going idle.

The inputs to DeviceIdleController (alarm manager, sensors)
hold wake locks while they call it.  But then the real work
happens in a handler which is outside of the wakelock, so
listeners don't get a chance to run right away, which in
the case of NetworkPolicyManager means the device is in a
higher power state than it should be.

It's not clear that this will 100% fix the bug, because
NetworkPolicyManagerService also has its own internal
Handler, and isn't holding its own wakelock for this,
but this change allows NPMS to be fixed if it really
needed to be.

Bug: 31900521
Test: adb shell dumpsys deviceidle step ... adb shell dumpsys power has no wakelocks held
Change-Id: I799f45221a6b327e7f63745cadc95ca644c064c6
(cherry picked from commit 8f0e9cede145bbc1668e25cfd6f850fe3fde3ae3)
services/core/java/com/android/server/DeviceIdleController.java