Use DocumentsUI AOSP "Files" app to browse a USB drive with one or more media files, then open an image or video there with Gallery.
Expected behavior
I expect the file to open in Gallery, and then I expect all the usual All Files Access linked options to be available: rename, view details, swipe to previous and next images/videos in that folder.
Actual behavior
The file opens, but Gallery cannot operate on that file directly and I cannot swipe to other files in the source folder.
Screenshots/Screen recordings
If I use Google Files, or Material Files, to browse a USB drive and open a file there with Gallery I can operate on that file and swipe through other files in that USB folder. In other words Gallery understands the file path URI from those file managers but doen not understand how to convert the URI from DocumentsUI to the file path. In my humble opinion Gallery should be able to parse the com.android.externalstorage URI and convert that to the (emulated) "real" file path.
Checklist
Affected app version
1.1.1
Affected Android/Custom ROM version
Android 11 +
Affected device model
Xperia 1 V
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
Use DocumentsUI AOSP "Files" app to browse a USB drive with one or more media files, then open an image or video there with Gallery.
Expected behavior
I expect the file to open in Gallery, and then I expect all the usual All Files Access linked options to be available: rename, view details, swipe to previous and next images/videos in that folder.
Actual behavior
The file opens, but Gallery cannot operate on that file directly and I cannot swipe to other files in the source folder.
Screenshots/Screen recordings
If I use Google Files, or Material Files, to browse a USB drive and open a file there with Gallery I can operate on that file and swipe through other files in that USB folder. In other words Gallery understands the file path URI from those file managers but doen not understand how to convert the URI from DocumentsUI to the file path. In my humble opinion Gallery should be able to parse the com.android.externalstorage URI and convert that to the (emulated) "real" file path.
Examples:
DocumentsUI
content://com.android.externalstorage.documents/document/6032-AB67%3ADCIM%2FVIDEO_20211231_191821%2Fframe-000002.dng
6032-AB67 = USB drive %3A = root of drive %2F = / Path = 6032-AB67/DCIM/VIDEO_20211231_191821/frame-000002.dng
Material Files
content://me.zhanghai.android.files.file_provider/file%253A%252F%252F%252Fmnt%252Fmedia_rw%252F6032-AB67%252FDCIM%252FVIDEO_20211231_191821%252Fframe-000002.dng
%252F = / Path = /mnt/media_rw/6032-AB67/DCIM/VIDEO_20211231_191821/frame-000002.dng
I think if you parse the AOSP Files URI and know to prepend "/mnt/media_rw/" you can reliably get the file path.
Additional information
No response