Add a service and set #StartAtBoot: true. It will start your app at boot. At this point you can check whether there is a connected USB device.
If you need to show an activity from the service then it will require the special "draw over apps" permission.
Thanks for the answer, but I don't think you see my problem, or I don't understand your solution.
I can autostart the app with some help of a third app to autolauch my app. Thats not the problem. I see I can avoid it with your help.
My problem is that if I plug the arduino after the android box is on, everything works, the app can access the USB automatically.
If I have the arduino plugged with the android box is off and I turn it on, I have to start the app "manually" and the USB permission box appears, I have to click give permission, and restart the app to work.
I still dont understand why with the " manifest/device_filter " working, it fails when the app is run, but it works perfect when I plug the arduino.
Thanks