0

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).

Jared Forth
  • 1,577
  • 6
  • 17
  • 32
bobford
  • 1
  • 1
  • Your issue looks similar to answer by Alexey Sviridov here https://stackoverflow.com/questions/16006889/usbmanager-getdevicelist-returns-empty – karan May 09 '19 at 05:52
  • Thank you, you're correct! But I don't know if this is an Android or manufacturer fault. – bobford May 09 '19 at 17:15
  • looks mostly like hardware issue. try for android 9 with other device – karan May 10 '19 at 05:08

0 Answers0