During the development of the application, we encountered a problem. We connect a USB flash drive to the device via OTG cable. We request access rights from the user, but in the end we get nothing.
As a result, we started looking at what the path to Total Commander looks like. It looks something like this: enter image description here
As a result, we realized that the system hides the file. Please tell me what permissions are needed so that you can access the flash drive files directly.
We tried to write simple Java code to display the contents of the folder on the screen, but we couldn't find the way to our flash drive.
String path = new File(Objects.requireNonNull(Environment.getExternalStorageDirectory().getParent())).getParent();
Tested on several devices, we noticed that only 2 flash drives are displayed and have access to them, since they are displayed on the path /storage/emulated/0, on the rest there is no and we will change the path ///USB_.
The permission we gave:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.USB_PERMISSION" />
!API 29!