ODPM: Add ODPM config file to be read by powerstats 2.0

Test: Ensure that there are no sepolicy errors when
/data/vendor/powerstats/odpm_config exists
Bug: 228112997

Change-Id: I094c29c4d1a82bccfabde7a5511f4aa833c2cd35
This commit is contained in:
Stephane Lee 2022-04-04 18:22:47 -07:00
parent 2a3100de6e
commit 5ce2f99f38
3 changed files with 7 additions and 0 deletions

View file

@ -14,6 +14,7 @@ type sensor_reg_data_file, file_type, data_file_type;
type per_boot_file, file_type, data_file_type, core_data_file_type;
type uwb_vendor_data_file, file_type, data_file_type, app_data_file_type;
type uwb_data_vendor, file_type, data_file_type;
type powerstats_vendor_data_file, file_type, data_file_type;
userdebug_or_eng(`
typeattribute tcpdump_vendor_data_file mlstrustedobject;
typeattribute vendor_slog_file mlstrustedobject;

View file

@ -204,6 +204,7 @@
/data/vendor/sensors/registry(/.*)? u:object_r:sensor_reg_data_file:s0
/data/vendor/uwb(/.*)? u:object_r:uwb_data_vendor:s0
/dev/battery_history u:object_r:battery_history_device:s0
/data/vendor/powerstats(/.*)? u:object_r:powerstats_vendor_data_file:s0
# Persist
/mnt/vendor/persist/battery(/.*)? u:object_r:persist_battery_file:s0

View file

@ -11,6 +11,11 @@ r_dir_file(hal_power_stats_default, sysfs_leds)
r_dir_file(hal_power_stats_default, sysfs_odpm)
r_dir_file(hal_power_stats_default, sysfs_scsi_devices_0000)
r_dir_file(hal_power_stats_default, sysfs_wifi)
r_dir_file(hal_power_stats_default, powerstats_vendor_data_file)
# Rail selection requires read/write permissions
allow hal_power_stats_default sysfs_odpm:dir search;
allow hal_power_stats_default sysfs_odpm:file rw_file_perms;
# getStateResidency AIDL callback for Bluetooth HAL
binder_call(hal_power_stats_default, hal_bluetooth_btlinux)