From 20010d199bcb2ea2a7a908d891a876b57bf6f1fc Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 25 Jul 2019 13:28:19 -0700 Subject: [PATCH] Allow update_engine to read virtual ab feature flag. Test: adb shell getprop -Z [the two flags] Bug: 135752105 Change-Id: I3e0372e969ea0161787c32560a8c40fed2953619 --- private/compat/29.0/29.0.ignore.cil | 1 + private/property_contexts | 4 ++++ public/property.te | 1 + public/update_engine_common.te | 3 +++ 4 files changed, 9 insertions(+) diff --git a/private/compat/29.0/29.0.ignore.cil b/private/compat/29.0/29.0.ignore.cil index 5a9706a03..40678438a 100644 --- a/private/compat/29.0/29.0.ignore.cil +++ b/private/compat/29.0/29.0.ignore.cil @@ -19,6 +19,7 @@ system_group_file system_passwd_file vendor_apex_file + virtual_ab_prop wifi_stack wifi_stack_service wifi_stack_tmpfs)) diff --git a/private/property_contexts b/private/property_contexts index 254c55a85..d1a97d9ab 100644 --- a/private/property_contexts +++ b/private/property_contexts @@ -212,3 +212,7 @@ ro.cold_boot_done u:object_r:cold_boot_done_prop:s0 # Charger properties ro.charger. u:object_r:charger_prop:s0 + +# Virtual A/B properties +ro.virtual_ab.enabled u:object_r:virtual_ab_prop:s0 +ro.virtual_ab.retrofit u:object_r:virtual_ab_prop:s0 diff --git a/public/property.te b/public/property.te index 1bac6133a..9dc204c7c 100644 --- a/public/property.te +++ b/public/property.te @@ -93,6 +93,7 @@ type time_prop, property_type; type traced_enabled_prop, property_type; type traced_lazy_prop, property_type; type use_memfd_prop, property_type; +type virtual_ab_prop, property_type; type vold_prop, property_type, core_property_type; type wifi_log_prop, property_type, log_property_type; type wifi_prop, property_type; diff --git a/public/update_engine_common.te b/public/update_engine_common.te index e53f78ecc..87e3b4318 100644 --- a/public/update_engine_common.te +++ b/public/update_engine_common.te @@ -76,3 +76,6 @@ allow update_engine_common block_device:dir r_dir_perms; # Allow update_engine_common to write to statsd socket. unix_socket_send(update_engine_common, statsdw, statsd) + +# Allow to read Virtual A/B feature flags. +get_prop(update_engine_common, virtual_ab_prop)