Added read only suspend hal properties

Bug: 170587692
Test: Inspected logs to confirm android.system.suspend can access the
properties

Change-Id: Ie6a84afe490df0d2b11ff4f06588c7bca68d9850
This commit is contained in:
Benjamin Schwartz 2020-10-30 13:55:21 -07:00
parent dd92be8271
commit 3e4d97b158
3 changed files with 20 additions and 0 deletions

View file

@ -16,6 +16,7 @@ system_internal_prop(lower_kptr_restrict_prop)
system_internal_prop(netd_stable_secret_prop)
system_internal_prop(pm_prop)
system_internal_prop(system_adbd_prop)
system_internal_prop(suspend_prop)
system_internal_prop(traced_perf_enabled_prop)
system_internal_prop(userspace_reboot_log_prop)
system_internal_prop(userspace_reboot_test_prop)
@ -284,6 +285,13 @@ compatible_property_only(`
} {
wifi_prop
}:file no_rw_file_perms;
neverallow {
domain
-init
} {
suspend_prop
}:property_service set;
')
compatible_property_only(`

View file

@ -95,6 +95,15 @@ test.userspace_reboot.requested u:object_r:userspace_reboot_test_prop:s0
sys.lmk. u:object_r:system_lmk_prop:s0
sys.trace. u:object_r:system_trace_prop:s0
# Suspend service properties
suspend.max_sleep_time_millis u:object_r:suspend_prop:s0 exact uint
suspend.base_sleep_time_millis u:object_r:suspend_prop:s0 exact uint
suspend.backoff_threshold_count u:object_r:suspend_prop:s0 exact uint
suspend.short_suspend_threshold_millis u:object_r:suspend_prop:s0 exact uint
suspend.sleep_time_scale_factor u:object_r:suspend_prop:s0 exact double
suspend.failed_suspend_backoff_enabled u:object_r:suspend_prop:s0 exact bool
suspend.short_suspend_backoff_enabled u:object_r:suspend_prop:s0 exact bool
# Fastbootd protocol control property
fastbootd.protocol u:object_r:fastbootd_protocol_prop:s0 exact enum usb tcp

View file

@ -18,6 +18,9 @@ r_dir_file(system_suspend, sysfs_wakeup_reasons)
# To resolve arbitrary sysfs paths from /sys/class/wakeup/* symlinks.
allow system_suspend sysfs_type:dir search;
# Access to suspend_hal system properties
get_prop(system_suspend, suspend_prop)
# To call BTAA registered callbacks
allow system_suspend bluetooth:binder call;