From b221e66301ab23bab0e6a4f7583722f681bd5eb6 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Tue, 5 May 2020 12:41:02 -0700 Subject: [PATCH] Add lmkd. property policies lmkd.reinit property allows vendors to trigger lmkd reinitialization. Add lmkd_prop to support lmkd.* properties inlcuding lmkd.reinit. Bug: 155149944 Test: setprop lmkd.reinit 1 Signed-off-by: Suren Baghdasaryan Change-Id: I6ba598bad7ebb40fd6f23de473f25f32e53c996d --- private/compat/29.0/29.0.ignore.cil | 1 + private/lmkd.te | 5 +++++ private/property_contexts | 1 + public/property.te | 1 + public/vendor_init.te | 1 + 5 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 fadc7dba3..e4719f54b 100644 --- a/private/compat/29.0/29.0.ignore.cil +++ b/private/compat/29.0/29.0.ignore.cil @@ -75,6 +75,7 @@ mirror_data_file light_service linkerconfig_file + lmkd_prop media_variant_prop metadata_bootstat_file mnt_pass_through_file diff --git a/private/lmkd.te b/private/lmkd.te index 724605138..1e7bbdeaa 100644 --- a/private/lmkd.te +++ b/private/lmkd.te @@ -4,3 +4,8 @@ init_daemon_domain(lmkd) # Set sys.lmk.* properties. set_prop(lmkd, system_lmk_prop) + +# Set lmkd.* properties. +set_prop(lmkd, lmkd_prop) + +neverallow { -init -lmkd -vendor_init } lmkd_prop:property_service set; diff --git a/private/property_contexts b/private/property_contexts index dffb3b0fe..4c1c00767 100644 --- a/private/property_contexts +++ b/private/property_contexts @@ -440,6 +440,7 @@ ro.lmk.thrashing_limit u:object_r:exported3_default_prop:s0 exact int ro.lmk.thrashing_limit_decay u:object_r:exported3_default_prop:s0 exact int ro.lmk.use_minfree_levels u:object_r:exported3_default_prop:s0 exact bool ro.lmk.upgrade_pressure u:object_r:exported3_default_prop:s0 exact int +lmkd.reinit u:object_r:lmkd_prop:s0 exact int ro.media.xml_variant.codecs u:object_r:media_variant_prop:s0 exact string ro.media.xml_variant.codecs_performance u:object_r:media_variant_prop:s0 exact string diff --git a/public/property.te b/public/property.te index 8e5a7fce6..62ad18290 100644 --- a/public/property.te +++ b/public/property.te @@ -143,6 +143,7 @@ system_public_prop(exported_system_radio_prop) system_public_prop(exported_wifi_prop) system_public_prop(sota_prop) system_public_prop(hwservicemanager_prop) +system_public_prop(lmkd_prop) system_public_prop(logd_prop) system_public_prop(logpersistd_logging_prop) system_public_prop(log_prop) diff --git a/public/vendor_init.te b/public/vendor_init.te index cd9664340..f95d0961c 100644 --- a/public/vendor_init.te +++ b/public/vendor_init.te @@ -226,6 +226,7 @@ set_prop(vendor_init, exported2_system_prop) set_prop(vendor_init, exported3_default_prop) set_prop(vendor_init, exported3_radio_prop) set_prop(vendor_init, incremental_prop) +set_prop(vendor_init, lmkd_prop) set_prop(vendor_init, logd_prop) set_prop(vendor_init, log_tag_prop) set_prop(vendor_init, log_prop)