Apps that use the USB OTG port under Android 7 work properly but fail on Android 9 returning deviceList.size() == 0
. The port works fine for reading files from a memory card with apps from the Play Store.
The phone is a Huawei Mate 20 Pro (LYA-L29) Android 9.
Code is the usual:
manager = (UsbManager) getSystemService(Context.USB_SERVICE);
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
if (deviceList.size() == 0) {
etc
As mentioned, this worked properly under Android 7 (Samsung).