In Init. A script-initiated service was added to the aaa.rc:
Service AAA /vendor/bin/sh /vendor/etc/aaa_spec.sh
User root
Group Root
Disabled
OneShot
On Post-fs-data
Start AAA
Via DMESG at system startup | grep init view found: Service AAA does not having a SELinux domain defined
Workaround:
1. Add the Aaa.te file under the devices/vendorxxx/sepolicy/common/directory, as follows:
Type AAA, domain;
Type aaa_exec, Exec_type, Vendor_file_type,file_type;
Init_daemon_domain (AAA)
Allow AAA vendor_shell_exec:file {entrypoint};
2. In the Devices/vendorxxx/sepolicy/android.mk file, add:
Board_sepolicy_dirs + = devices/vendorxxx/sepolicy/common/
3. Add in devices/vendorxxx/sepolicy/common/file_contexts:
# #add for AAA file permission##
/(Vendor|system/vendor)/etc/aaa_spec\.sh U:object_r:aaa_exec:s0
4. In Init. Aaa.rc inside the corresponding service inside add:
Service AAA /vendor/bin/sh /vendor/etc/aaa_spec.sh
User root
Group Root
Disabled
OneShot
Seclabel U:r:carrier_switcher:s0
5. Compile and burn bootimage, if compile error attention to resolve Neverallow conflict
6. When the system is found, if AVC is added to the Allow policy statement
"Android O" Service AAA does not has a SELinux domain defined