OSDN Git Service

Ability to choose either suspend counter or /sys/power/wake_lock.
authorTri Vo <trong@google.com>
Wed, 20 Mar 2019 04:42:09 +0000 (21:42 -0700)
committerTri Vo <trong@google.com>
Thu, 21 Mar 2019 22:42:13 +0000 (15:42 -0700)
commita833d47822343c18d398e464dac1b0f7b09b5643
treee907e95099216aa69567c920b02e600ff58c1d1d
parent28d18ced6faeaf49958f00e6f0cc9499860d1436
Ability to choose either suspend counter or /sys/power/wake_lock.

Suspend blocker that are kept track of by SystemSuspend can now be
backed by either a ref-counter OR /sys/power/wake_lock interface.

We need /sys/power/wake_[un]lock to export debugging info via
/sys/kernel/debug/wakeup_sources. We do this to preserve the workflow
with existing toolchains.

In the future, we want to keep all native wake lock debugging info in
SystemSuspend. That info will then be exposed directly to our tools.

Debug info in /d/wakeup_sources might be misaligned if there wake locks
with colliding names on the device. There are no such cases in Android
platform or pixel devices.

Bug: 128923994
Test: SystemSuspendV1_0UnitTest
Test: device suspends if left alone
Test: /d/wakeup_sources keeps track of all native wake locks
Change-Id: I7d15fca42efca945122ec0671f424e75e186f5d8
suspend/1.0/default/SystemSuspend.cpp
suspend/1.0/default/SystemSuspend.h
suspend/1.0/default/android.system.suspend@1.0-service.rc
suspend/1.0/default/main.cpp