It seems that it's something with the USB or Drive Permissions. On my ODROID C2 with Android 6 it's working fine. But with my Moto G5 (Android 7) and Asus Zen Tablet (Android 6) it's not working.
I can select a file with "Intent.ACTION_OPEN_DOCUMENT" File Picker, and on all devices the Document Path is the same... but, some of the Volumes are not there:
Asus Zen (Android 6)
Volume: /storage/emulated/0
selected file: /storage/7C23-16EA/m_BlueforLabrusca.mp3
.
.
.
ODroid C2 (Android 6)
Volume: /storage/emulated/0
Volume: /storage/internal
Volume: /storage/7C23-16EA
selected file: /storage/7C23-16EA/m_BlueforLabrusca.mp3
StorageManager storageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
Class<?> StorageVolume = Class.forName("android.os.storage.StorageVolume");
Method getVolumeListMethod = StorageManager.class.getDeclaredMethod("getVolumeList");
Method methodGetPath = StorageVolume.getDeclaredMethod("getPath");
Object[] storageVolumeList = (Object[]) getVolumeListMethod.invoke(storageManager);
final int length = Array.getLength(storageVolumeList);
for (int i = 0; i < length; i++) {
Object storageVolumeElement = Array.get(storageVolumeList, i);
String path = (String) methodGetPath.invoke(storageVolumeElement);
path = new File(path).getAbsolutePath();
volumes.add(new File(path));
Log.i("!!!","Volume: " + path);
}