OSDN Git Service

Handle /sys/power/* interfaces not being available.
authorTri Vo <trong@google.com>
Thu, 20 Dec 2018 20:53:04 +0000 (12:53 -0800)
committerTri Vo <trong@google.com>
Thu, 20 Dec 2018 21:11:35 +0000 (13:11 -0800)
commit0dbe3f326dec3d8378c27b19892d681a89a848e4
tree7be206ae5576cc239100f0ce5bcb188c182b7522
parentba81fb29c4998647baf5fe0fa313a14d87b92eff
Handle /sys/power/* interfaces not being available.

If either /sys/power/wakeup_count or /sys/power/state fail to open, we
construct SystemSuspend with blocking fds. This way this process will
keep running, handle wake lock requests, collect stats, but won't
suspend the device.

We want this behavior on devices (hosts) where system suspend should not
be handles by Android platform e.g. ARC++, Android virtual devices.

Bug: 118637369
Test: Remove system.suspend access to /sys/power/{ wakeup_count state }
using SELinux. Device still boots and doesn't suspend.
Change-Id: I068a584ada6968520219ee5288f598a53aa48c68
suspend/1.0/default/main.cpp