Skip to content

Commit

Permalink
Sepolicy for android_pm_tune script
Browse files Browse the repository at this point in the history
Adding the required domain and rules for
executing android_pm_tune script to obtain
the power optimization during idle display
conditions.

Tests done : Boot Test done

Tracked-On: OAM-125227
Signed-off-by: amarjeet-intel <[email protected]>
  • Loading branch information
amarjeet-intel authored and sysopenci committed Nov 22, 2024
1 parent 827bab7 commit 68f251d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
33 changes: 33 additions & 0 deletions power/android_pm_tune.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Rules for android_pm_tune script
type android_pm_tune, domain;
type android_pm_tune_exec, exec_type, file_type, vendor_file_type;
init_daemon_domain(android_pm_tune)

allow android_pm_tune proc_cmdline:file r_file_perms;
allow android_pm_tune proc:file rw_file_perms;
allow android_pm_tune sysfs:dir r_dir_perms;
allow android_pm_tune sysfs:file rw_file_perms;
allow android_pm_tune sysfs_net:dir r_dir_perms;
allow android_pm_tune sysfs_net:file rw_file_perms;
allow android_pm_tune sysfs_app_readable:file rw_file_perms;
allow android_pm_tune sysfs_app_readable:dir r_dir_perms;
allow android_pm_tune sysfs_gfx:file {getattr};

allow android_pm_tune dbc_sysfs:dir r_dir_perms;
allow android_pm_tune dbc_sysfs:file rw_file_perms;

allow android_pm_tune sysfs_virtio:file rw_file_perms;

allow android_pm_tune vendor_file:file rx_file_perms;
allow android_pm_tune proc_cpuinfo:file r_file_perms;
allow android_pm_tune vendor_toolbox_exec:file execute_no_trans;

not_full_treble(`
allow android_pm_tune system_file:file rx_file_perms;
allow android_pm_tune shell_exec:file rx_file_perms;
')
full_treble_only(`
allow android_pm_tune vendor_shell_exec:file rx_file_perms;
allow android_pm_tune vendor_toolbox_exec:file rx_file_perms;
')

2 changes: 2 additions & 0 deletions power/file_contexts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/(vendor|system/vendor)/bin/hw/android\.hardware\.power@[0-9]+.?[0-9]*-service u:object_r:hal_power_service_exec:s0
# Power HAL helper
(/system)?/vendor/bin/power_hal_helper u:object_r:power_hal_helper_exec:s0
# android_power_tune
(/system)?/vendor/bin/android_pm_tune.sh u:object_r:android_pm_tune_exec:s0
1 change: 1 addition & 0 deletions power/shell.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow shell android_pm_tune_exec:file getattr;

0 comments on commit 68f251d

Please sign in to comment.