WLC: Add the essential sysfs_wlc policy files

1. Add the essential sysfs_wlc policy files to gs-common to cleanup the
wireless_charger module dependent problems
2. Move out sepolicy type definitions to each device so the sepolicy can
be self contained

Bug: 263830018
Change-Id: I46da58685c5180d774fc445dc1f1c6f3a1780cc0
Signed-off-by: Ken Yang <yangken@google.com>
This commit is contained in:
Ken Yang 2023-01-05 06:30:28 +00:00
parent 26eb4f5f17
commit 2e7a9e8004
10 changed files with 12 additions and 6 deletions

View File

@ -1 +0,0 @@
type sysfs_wlc, sysfs_type, fs_type;

View File

@ -0,0 +1,3 @@
allow hal_dumpstate_default sysfs_wlc:dir search;
allow hal_dumpstate_default sysfs_wlc:dir r_dir_perms;
allow hal_dumpstate_default sysfs_wlc:file r_file_perms;

View File

@ -0,0 +1,2 @@
r_dir_file(hal_googlebattery, sysfs_wlc)
allow hal_googlebattery sysfs_wlc:file rw_file_perms;

View File

@ -0,0 +1 @@
allow hal_health_default sysfs_wlc:dir search;

View File

@ -0,0 +1 @@
allow hal_sensors_default sysfs_wlc:dir r_dir_perms;

View File

@ -1,6 +1,3 @@
type hal_wireless_charger, domain;
type hal_wireless_charger_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_wireless_charger)
r_dir_file(hal_wireless_charger, sysfs_batteryinfo)

View File

@ -0,0 +1,3 @@
# Wireless charge
allow pixelstats_vendor sysfs_wlc:dir search;
allow pixelstats_vendor sysfs_wlc:file rw_file_perms;

View File

@ -1 +0,0 @@
type hal_wireless_charger_service, hal_service_type, protected_service, service_manager_type;

View File

@ -0,0 +1,2 @@
# wlc
dontaudit shell sysfs_wlc:dir search;

View File

@ -1,4 +1,3 @@
PRODUCT_SOONG_NAMESPACES += vendor/google/interfaces
PRODUCT_PACKAGES += vendor.google.wireless_charger-default
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/wireless_charger/compatibility_matrix.xml