From 4cad299072a644bbce5681949bb79569bc738f9d Mon Sep 17 00:00:00 2001 From: Wilson Sung Date: Tue, 26 Dec 2023 19:14:49 +0800 Subject: [PATCH] Allow systemui to write protolog file This is enabled on debuggable builds only, includes - Grant mlstrustedsubject typeattribute to wm_trace_data_file - Grant systemui the write access to wm_trace_data_file Bug: 251513116 Bug: 288049075 Test: make sepolicy Change-Id: I47c9bbf13835b2e7eaac3e2b436e3b486ce02431 --- system_ext/private/systemui_app.te | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system_ext/private/systemui_app.te b/system_ext/private/systemui_app.te index 741d49f..6d3d87f 100644 --- a/system_ext/private/systemui_app.te +++ b/system_ext/private/systemui_app.te @@ -16,3 +16,10 @@ allow systemui_app statsmanager_service:service_manager find; get_prop(systemui_app, keyguard_config_prop) set_prop(systemui_app, bootanim_system_prop) get_prop(systemui_app, qemu_hw_prop) + +# Allow writing and removing wmshell protolog in /data/misc/wmtrace. +userdebug_or_eng(` + allow systemui_app wm_trace_data_file:dir rw_dir_perms; + allow systemui_app wm_trace_data_file:file create_file_perms; +') +