From fface22c8a5d1492eb1d73f34d8cceffcef736e4 Mon Sep 17 00:00:00 2001 From: samou Date: Wed, 8 Nov 2023 02:00:15 +0000 Subject: [PATCH 1/2] bcl: Create lastmeal.csv Bug: 293899466 Change-Id: I0b7160177da66a598288d2e1782e6c244b02636e Signed-off-by: samou --- battery_mitigation/battery_mitigation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/battery_mitigation/battery_mitigation.cpp b/battery_mitigation/battery_mitigation.cpp index 79c7ec1..101be13 100644 --- a/battery_mitigation/battery_mitigation.cpp +++ b/battery_mitigation/battery_mitigation.cpp @@ -91,6 +91,7 @@ const struct MitigationConfig::EventThreadConfig eventThreadCfg = { .StoringPath = "/data/vendor/mitigation/thismeal.bin", .ParsedThismealPath = "/data/vendor/mitigation/thismeal.txt", .ParsedLastmealPath = "/data/vendor/mitigation/lastmeal.txt", + .ParsedLastmealCSVPath = "/data/vendor/mitigation/lastmeal.csv", .FvpStatsPath = "/sys/devices/platform/acpm_stats/fvp_stats", .PmicCommon = { /* Main Pmic */ @@ -183,7 +184,8 @@ int main(int argc, char **argv) { mitigationLogTimeValid = batteryMitigationService->isTimeValid(eventThreadCfg.StoringPath, batteryMitigationStartTime); if (!reason.empty() && mitigationLogTimeValid && - batteryMitigationService->genParsedMeal(eventThreadCfg.ParsedLastmealPath)) { + batteryMitigationService->genParsedMeal(eventThreadCfg.ParsedLastmealPath) && + batteryMitigationService->genLastmealCSV(eventThreadCfg.ParsedLastmealCSVPath)) { android::base::SetProperty(kLastMealProperty, "1"); } /* Start BrownoutEventThread to poll brownout event from kernel */ From 9f6785063af2bb5c7a11b79a9d98218f3d0e6493 Mon Sep 17 00:00:00 2001 From: feiyuchen Date: Mon, 26 Jun 2023 02:00:24 +0000 Subject: [PATCH 2/2] Add SEPolicy for audio HAL to use EdgeTpu The added policies for Audio HAL (`hal_audio_default`) are exactly the same as Camera HAL (`hal_camera_default`). Background: Audio team is migrating audio processing offload to TPU. POR is for Android U QPR. Design doc: https://docs.google.com/document/d/1KarcXFbfiJVxHDFgT5AYNE0-tUc0cr_63dCNK-5HQys/edit?resourcekey=0-J-4NEenhAWuoa5Ou7ZGYgw Bug: 289466639 Change-Id: I02b7ba4e4956b0db615b21a88dc47b615cc66e44 Test: It was tested in above Bug that Audio HAL could use EdgeTpu --- edgetpu/sepolicy/hal_audio_default.te | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 edgetpu/sepolicy/hal_audio_default.te diff --git a/edgetpu/sepolicy/hal_audio_default.te b/edgetpu/sepolicy/hal_audio_default.te new file mode 100644 index 0000000..2646fcc --- /dev/null +++ b/edgetpu/sepolicy/hal_audio_default.te @@ -0,0 +1,14 @@ +# Allow the audio hal to access the EdgeTPU service and the +# Android shared memory allocated by the EdgeTPU service for +# on-device compilation. +allow hal_audio_default edgetpu_device:chr_file rw_file_perms; +allow hal_audio_default edgetpu_vendor_service:service_manager find; +binder_call(hal_audio_default, edgetpu_vendor_server) + +# Allow edgetpu_app_service as well, due to the EdgeTpu metrics logging +# library has a dependency on edgetpu_app_service, see b/275016466. +allow hal_audio_default edgetpu_app_service:service_manager find; +binder_call(hal_audio_default, edgetpu_app_server) + +# Allow audio HAL to read tflite Darwinn delegate properties +get_prop(hal_audio_default, vendor_tflite_delegate_prop)