Add userspace_reboot_test_prop
This property type represents properties used in CTS tests of userspace
reboot. For example, test.userspace_reboot.requested property which is
used to check that userspace reboot was successful and didn't result in
full reboot, e.g.:
* before test setprop test.userspace_reboot.requested 1
* adb reboot userspace
* wait for boot to complete
* verify that value of test.userspace_reboot.requested is still 1
Test: adb shell setprop test.userspace_reboot.requested 1
Bug: 150901232
Change-Id: I45d187f386149cec08318ea8545ab864b5810ca8
Merged-In: I45d187f386149cec08318ea8545ab864b5810ca8
(cherry picked from commit 3bd53a9ceecc37c79090c59776408b3d4733b036)
diff --git a/private/compat/29.0/29.0.ignore.cil b/private/compat/29.0/29.0.ignore.cil
index e373726..c1ea949 100644
--- a/private/compat/29.0/29.0.ignore.cil
+++ b/private/compat/29.0/29.0.ignore.cil
@@ -105,6 +105,7 @@
userspace_reboot_config_prop
userspace_reboot_exported_prop
userspace_reboot_log_prop
+ userspace_reboot_test_prop
vehicle_hal_prop
tv_tuner_resource_mgr_service
vendor_apex_file
diff --git a/private/domain.te b/private/domain.te
index 32b40c1..3f5bbaa 100644
--- a/private/domain.te
+++ b/private/domain.te
@@ -101,6 +101,7 @@
get_prop({coredomain appdomain shell}, userspace_reboot_config_prop)
get_prop({coredomain shell}, userspace_reboot_exported_prop)
get_prop({coredomain shell}, userspace_reboot_log_prop)
+ get_prop({coredomain shell}, userspace_reboot_test_prop)
get_prop({domain -coredomain -appdomain}, vendor_default_prop)
')
diff --git a/private/property_contexts b/private/property_contexts
index 1977fff..216531c 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -91,6 +91,7 @@
sys.boot.reason.last u:object_r:last_boot_reason_prop:s0
pm. u:object_r:pm_prop:s0
test.sys.boot.reason u:object_r:test_boot_reason_prop:s0
+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
diff --git a/private/shell.te b/private/shell.te
index 2c69f95..76ff073 100644
--- a/private/shell.te
+++ b/private/shell.te
@@ -73,6 +73,10 @@
set_prop(shell, lpdumpd_prop);
binder_call(shell, lpdumpd)
+# Allow shell to set and read value of properties used for CTS tests of
+# userspace reboot
+set_prop(shell, userspace_reboot_test_prop)
+
# Allow shell to get encryption policy of /data/local/tmp/, for CTS
allowxperm shell shell_data_file:dir ioctl {
FS_IOC_GET_ENCRYPTION_POLICY
diff --git a/public/property.te b/public/property.te
index cfaa190..67a1fbe 100644
--- a/public/property.te
+++ b/public/property.te
@@ -21,6 +21,7 @@
system_internal_prop(netd_stable_secret_prop)
system_internal_prop(pm_prop)
system_internal_prop(userspace_reboot_log_prop)
+system_internal_prop(userspace_reboot_test_prop)
system_internal_prop(system_adbd_prop)
system_internal_prop(adbd_prop)
system_internal_prop(traced_perf_enabled_prop)
@@ -587,3 +588,11 @@
} {
adbd_prop
}:property_service set;
+
+neverallow {
+ # Only allow init and shell to set userspace_reboot_test_prop
+ -init
+ -shell
+} {
+ userspace_reboot_test_prop
+}:property_service set;