From 1145be1fc3424470e325565d4b4bbb4006c8e925 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 8 Jul 2019 10:57:46 -0700 Subject: [PATCH] Allow charger to read ro.charger.* Allow charger to read system properties with this prefix so that charger's behavior is controlled by runtime. Test: run offline charging on walleye Bug: 124118169 Change-Id: I4266b2d043a5323b4adbd1636ada46b7e08ca667 --- private/compat/29.0/29.0.ignore.cil | 1 + private/property_contexts | 3 +++ public/charger.te | 2 ++ public/property.te | 1 + 4 files changed, 7 insertions(+) diff --git a/private/compat/29.0/29.0.ignore.cil b/private/compat/29.0/29.0.ignore.cil index 225b5829a..7f5669cf1 100644 --- a/private/compat/29.0/29.0.ignore.cil +++ b/private/compat/29.0/29.0.ignore.cil @@ -5,6 +5,7 @@ (typeattribute new_objects) (typeattributeset new_objects ( new_objects + charger_prop cold_boot_done_prop ctl_apexd_prop device_config_sys_traced_prop diff --git a/private/property_contexts b/private/property_contexts index 520383de0..9df2608ff 100644 --- a/private/property_contexts +++ b/private/property_contexts @@ -206,3 +206,6 @@ ro.nnapi.extensions.deny_on_product u:object_r:nnapi_ext_deny_pro # Property that is set once ueventd finishes cold boot. ro.cold_boot_done u:object_r:cold_boot_done_prop:s0 + +# Charger properties +ro.charger. u:object_r:charger_prop:s0 diff --git a/public/charger.te b/public/charger.te index 238b41373..48d6ad8e0 100644 --- a/public/charger.te +++ b/public/charger.te @@ -42,3 +42,5 @@ set_prop(charger, system_prop) set_prop(charger, exported_system_prop) set_prop(charger, exported2_system_prop) set_prop(charger, exported3_system_prop) + +get_prop(charger, charger_prop) diff --git a/public/property.te b/public/property.te index 67aa55db8..fa397d715 100644 --- a/public/property.te +++ b/public/property.te @@ -6,6 +6,7 @@ type bluetooth_audio_hal_prop, property_type; type bluetooth_prop, property_type; type bpf_progs_loaded_prop, property_type; type bootloader_boot_reason_prop, property_type; +type charger_prop, property_type; type cold_boot_done_prop, property_type; type config_prop, property_type, core_property_type; type cppreopt_prop, property_type, core_property_type;