[Android] ExternalBrowser: add specific condition for Amaze

Duncan McNamara git at videolan.org
Mon Jun 19 05:42:45 UTC 2023


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Jun 13 18:31:39 2023 +0200| [33d7d4f0e54c909a135a391cd7de3128b61a6fad] | committer: Duncan McNamara

ExternalBrowser: add specific condition for Amaze

Amaze adds a /storage_root at the beginning of the uri path it shares
which causes a fallback to opening the file using an fd. This recreates
a uri from the path after correcting it.

> https://code.videolan.org/videolan/vlc-android/commit/33d7d4f0e54c909a135a391cd7de3128b61a6fad
---

 application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt b/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt
index 868874db54..c27f6cc429 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt
@@ -373,6 +373,8 @@ object FileUtils {
                     CloseableUtils.close(os)
                     CloseableUtils.close(cursor)
                 }
+            } else if (data.host == "com.amaze.filemanager" && data.path != null) {
+                uri = Uri.parse(data.path!!.replace("/storage_root", "file://"))
             } else if (data.authority == "media") {
                 uri = MediaUtils.getContentMediaUri(data)
             } else if (data.authority == ctx.getString(R.string.tv_provider_authority)) {



More information about the Android mailing list