Hi,
This is the final configuration and it's resolve the clean build issue,
1. give permissive to run the service
BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
2. start the service from init
# Start the service
start usb
# Provide the root permission to the script
exec - root root vendor -- /vendor/bin/usb.sh
# start the usb service
service usb /vendor/bin/usb.sh
class main
user root
group root system
disabled
oneshot
seclabel u:r:usb:s0
3. add in file context,
/vendor/bin/usb.sh u:object_r:usb_exec:s0
4. Define sepolicy.
type usb, domain;
type usb_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(usb)
Thanks & Regards,
VinothS,
Regards,
Vinothkumar Sekar