From b72e47e1b0d13dc52883276b1350144efdb9d7a0 Mon Sep 17 00:00:00 2001 From: George Lee Date: Mon, 10 Oct 2022 09:40:51 -0700 Subject: [PATCH] bcl: Add brownout boot reason sepolicy Lastmeal.txt may be generated from after device rebooted from IRQ triggering. By applying limit on the time when it generates, lastmeal.txt will not be generated after device rebooted. Bug: 246817058 Test: Confirm lastmeal.txt generation Signed-off-by: George Lee Change-Id: I02515fc452dbfa5c8a40041cbb8731664dace62e --- whitechapel_pro/battery_mitigation.te | 1 + whitechapel_pro/property.te | 2 ++ whitechapel_pro/property_contexts | 2 ++ whitechapel_pro/vendor_init.te | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/whitechapel_pro/battery_mitigation.te b/whitechapel_pro/battery_mitigation.te index 5fecbcba..56b83733 100644 --- a/whitechapel_pro/battery_mitigation.te +++ b/whitechapel_pro/battery_mitigation.te @@ -2,6 +2,7 @@ type battery_mitigation, domain; type battery_mitigation_exec, exec_type, vendor_file_type, file_type; init_daemon_domain(battery_mitigation) get_prop(battery_mitigation, boot_status_prop) +get_prop(battery_mitigation, vendor_startup_bugreport_requested_prop) set_prop(battery_mitigation, vendor_mitigation_ready_prop) hal_client_domain(battery_mitigation, hal_thermal); diff --git a/whitechapel_pro/property.te b/whitechapel_pro/property.te index b88506be..151cefc3 100644 --- a/whitechapel_pro/property.te +++ b/whitechapel_pro/property.te @@ -39,3 +39,5 @@ vendor_internal_prop(vendor_telephony_app_prop) # Battery Mitigation vendor_internal_prop(vendor_mitigation_ready_prop) +vendor_internal_prop(vendor_brownout_boot_reason_prop) +vendor_internal_prop(vendor_startup_bugreport_requested_prop) diff --git a/whitechapel_pro/property_contexts b/whitechapel_pro/property_contexts index f4c5eeb0..02b9ce80 100644 --- a/whitechapel_pro/property_contexts +++ b/whitechapel_pro/property_contexts @@ -109,3 +109,5 @@ vendor.config.debug. u:object_r:vendor_telephony_app_prop: # Battery Mitigation vendor.brownout.mitigation.ready u:object_r:vendor_mitigation_ready_prop:s0 +vendor.brownout_boot_reason u:object_r:vendor_brownout_boot_reason_prop:s0 +vendor.startup_bugreport_requested u:object_r:vendor_startup_bugreport_requested_prop:s0 diff --git a/whitechapel_pro/vendor_init.te b/whitechapel_pro/vendor_init.te index 3287d344..0dedd097 100644 --- a/whitechapel_pro/vendor_init.te +++ b/whitechapel_pro/vendor_init.te @@ -35,3 +35,7 @@ set_prop(vendor_init, vendor_battery_defender_prop) # Display set_prop(vendor_init, vendor_display_prop) + +# Battery Mitigation +set_prop(vendor_init, vendor_brownout_boot_reason_prop) +set_prop(vendor_init, vendor_startup_bugreport_requested_prop)