I am trying to connect my Android tablet with Lollipop 5.1 installed to a FTDI 232RL USB chip in order to manage a serial communication. I have a problem with the USB permission when I connect the device via USB. There is a way to grant the permission programmatically without touching the dialog that appear when the USB is attached? For Android 4.1 I have implemented this solution (the answer of Alvins) and it works perfectly:
bypass android usb host permission confirmation dialog
For Android 5.1 I have also tried the following solutions but with no success:
bypass android usb host permission confirmation dialog for android 5.1
USB device access pop-up suppression?
Thanks in advance