Commit graph

16 commits

Author SHA1 Message Date
Steve Muckle
75603e3ccd allow writes to /sys/power/sync_on_suspend from init
When suspend.disable_sync_on_suspend is set init must write to
/sys/power/sync_on_suspend.

Bug: 285395636
Change-Id: Ica1b039c3192f08ec84aa07d35c2d0c61e7449c0
2023-10-04 07:44:33 +00:00
Kalesh Singh
a0a55e0e23 suspend: Allow access to /sys/power/wake_[un]lock
This is needed to prevent autosuspend when the framework is restarting
See: go/no-suspend-deadlocks

Bug: 255898234
Test: Check logcat for avc denials
Change-Id: I6313e28d0f2e4bc553881fcc3742dc74ca319b44
2022-12-14 14:18:55 -08:00
Kalesh Singh
0e903620a5 sepolicy: Serve suspend AIDL hal from system_suspend
Allow system_suspend to server the suspend AIDL hal service.

Bug: 170260236
Test: Check logcat for supend avc denials
Change-Id: Ie4c07e2e8d75fd4b12e55db15511060e09be59cf
2021-07-20 18:54:55 +00:00
Darren Hsu
70ae5f4c34 sepolicy: Create new attribute to serve ISuspendControlServiceInternal
Bug: 178417023
Test: Verified manually
Change-Id: Ie058ecf6b31c260e7788cbf0e74fa4182129d3e1
Signed-off-by: Darren Hsu <darrenhsu@google.com>
2021-02-25 18:04:04 +08:00
Kalesh Singh
215751ac6f Sepolicy for dumsys suspend_control in bugreport
Bug: 155836352
Test: adb shell am bug-report && check logcat for denials
Change-Id: I8b65ea7c798121679bf27ce667c787a8dcbf5aae
2020-11-23 19:04:04 -05:00
Benjamin Schwartz
3e4d97b158 Added read only suspend hal properties
Bug: 170587692
Test: Inspected logs to confirm android.system.suspend can access the
properties

Change-Id: Ie6a84afe490df0d2b11ff4f06588c7bca68d9850
2020-11-09 15:47:12 -08:00
Michael Sun
6445f190e8 Update to support splitted SystemSuspend AIDL interfaces
The suspend_control_aidl_interface is updated, renamed, and splitted
into android.system.suspend.control and
android.system.suspend.control.internal. This resulted in two suspend
services, update sepolicy to support this change.

Test: m
Bug: 171598743
Change-Id: I695bde405672af834fe662242347e62079f2e25f
2020-11-02 23:54:21 +00:00
Michael Sun
9cb662bdba Allow SystemSuspend to read from sysfs_wakeup_reasons
This allows the SystemSuspend to read wakeup reasons from
sysfs_wakeup_reasons.

Test: Local test verified SystemSuspend can access sysfs_wakeup_reasons
Bug: 171021049
Change-Id: Ic5d723a989edbcbd55ff497a55ce8384ba1f226c
2020-10-16 07:22:44 +00:00
Michael Sun
666992ecbb Allow SystemSuspend to call Bluetooth via binder
This allows the SystemSuspend to serve Bluetooth registered callbacks
for BTAA purpose.

Test: Local test verified registered callbacks been serviced
Bug: 170315554
Change-Id: I358b6732fdb663dcffd2647b6d6fa9727be5564e
2020-10-14 19:49:20 +00:00
Michael Sun
df54a52135 Allow Bluetooth to access SystemSuspend control service
This allows the Bluetooth to communicate with the SystemSuspend to
obtain system wakeup and wakelock information for Bluetooth activity
attribution (BTAA) processing.

BTAA is a process unit within the Bluetooth stack to aggregate
Bluetooth traffics, wakeup, and wakelocks into per-app, per-device, and
activity based statistical information.

Test: Local test verified Bluetooth can acquire suspend_control
Bug: 170315554
Change-Id: I7417132793c1000a8e3136c300cf8c1ba9cc3a14
2020-10-14 00:31:01 +00:00
Tri Vo
e3e77ed264 system_suspend: sysfs path resolution
/sys/class/wakeup/wakeupN can point to an arbitrary path in sysfs. Add
"search" permission for path resolution.

Bug: 144095608
Test: m selinux_policy
Change-Id: I033d15b4ca56656f144189f5c2b1b885f30155a3
2019-11-12 13:47:26 -08:00
Tri Vo
5f1ac02157 system_suspend access to suspend, wakeup stats
Android is moving away from debugfs. Information from /d/wakeup_sources
and /d/suspend_stats is now also exposed in sysfs under
/sys/class/wakeup/* and /sys/power/suspend_stats/* respectively:

  https://lkml.org/lkml/2019/7/31/1349
  https://lkml.org/lkml/2019/8/6/1275

Allow SystemSuspend to read those sysfs nodes.

One caveat is that /sys/class/wakeup/wakeupN can be a symlink to a
device-specific location. In this case, device sepolicy should label
that the files appropriately. This is similar to how device policy
applies "sysfs_net" and "sysfs_batteryinfo" labels.

Bug: 144095608
Bug: 129087298
Test: boot cuttlefish; system_suspend is able to read
/sys/power/suspend_stats/* and /sys/class/wakeup/*
Change-Id: I350c88a271c0f422d0557aeb5e05e1537dc97bc9
2019-11-07 13:50:32 -08:00
Tri Vo
5a5266e74c system_suspend: remove /sys/power/wake_lock permissions
Now that our tools are routed to system_suspend, there is no reason for
system_suspend to write to /sys/power/wake_[un]lock.

Bug: 128923994
Bug: 115946999
Test: boot blueline, no denials from system_suspend
Change-Id: I1097d30c050ce7d88677e07f4aaef07ce78dc958
2019-07-26 11:13:05 -07:00
Tri Vo
8730aeb2e9 Allow system_suspend access to /sys/power/wake_[un]lock.
Bug: 128923994
Test: boot taimen, no denials when writing to /sys/power/wake_[un]lock
Change-Id: Ib9ade5e532f906d2228642dfa5f52f609e559199
2019-03-19 21:34:49 -07:00
Tri Vo
131fa73add Restrict access to suspend control
Test: m selinux_policy
Change-Id: Ieccfd2aa059da065ace4f2db1b9634c52dd2cb24
2019-03-07 18:31:58 +00:00
Tri Vo
a532088e7f Decouple system_suspend from hal attributes.
System suspend service is not a HAL, so avoid using HAL-specific macros
and attributes.

Use system_suspend_server attribute for ISystemSuspend.hal permissions.
Use system_suspend type directly for internal .aidl interface
permissions.

Bug: 126259100
Test: m selinux_policy
Test: blueline boots; wakelocks can still be acquired; device suspends
if left alone.
Change-Id: Ie811e7da46023705c93ff4d76d15709a56706714
2019-02-26 18:10:28 -08:00