I have an Android app "MyProgram", which runs as a Device Owner in Lock Task Mode on a non-rooted Dedicated Device, an off-the-shelf tablet with Android 10.
On each start MyProgram checks if it has the permission, and if not, it calls android.hardware.usb.UsbManager.requestPermission() which shows a dialog asking the user to grant permission to access the USB.
I have already added the intent filter so now it doesn't ask for the permission each time the device is re-connected.
But still, each time the tablet is rebooted it asks for the permission again.
That happens even if I check "Always open MyProgram when USB UART is connected".
How can my app obtain a permanent permission to access the USB, such that the user won't need to grant it each time?