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
diff --git a/private/compat/29.0/29.0.ignore.cil b/private/compat/29.0/29.0.ignore.cil
index 225b582..7f5669c 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 520383d..9df2608 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -206,3 +206,6 @@
# 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 238b413..48d6ad8 100644
--- a/public/charger.te
+++ b/public/charger.te
@@ -42,3 +42,5 @@
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 67aa55d..fa397d7 100644
--- a/public/property.te
+++ b/public/property.te
@@ -6,6 +6,7 @@
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;