I want to disable the OTG (USB) on Android 9. I coud control it on Android 6 by disabling a permission on the file android.hardware.usb.host.xml located in /system/etc/permission but it is not working anymore on Android 9. Any idea?
Follow the steps below:
Open the Android settings, touch the menu button and select Settings or Android Settings from the menu that appears.
Then on the Settings screen, you will show many different settings broken down under different categories. Scroll down the list of all the settings and touch Storage when you find it.
In the Storage settings, you will find the option to Unmount USB storage near the bottom of the screen – then select this option to start the unmounting of OTG (USB) storage devices connected to your phone via OTG or USB cable.
You will be shown a confirmation screen - if you really want to unmount the USB storage. Touch OK to continue and unmount the OTG storage.
After the OTG storage has been successfully unmounted in Android, you can remove the OTG cable from your Android device without worrying about any data loss.