From 8ba5e05421555dc61147a5d8e1c13b2af87e68a6 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 21 Oct 2023 21:40:13 +0200 Subject: [PATCH] android scoped storage: default to hack the uri manually in getParentUri If DocumentsContract.Path.getPath() fails, try to hack the uri manually instead of returning null/empty (android 10) --- .../src/main/java/com/flycast/emulator/AndroidStorage.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/shell/android-studio/flycast/src/main/java/com/flycast/emulator/AndroidStorage.java b/shell/android-studio/flycast/src/main/java/com/flycast/emulator/AndroidStorage.java index f3771905d..ce56bdaeb 100644 --- a/shell/android-studio/flycast/src/main/java/com/flycast/emulator/AndroidStorage.java +++ b/shell/android-studio/flycast/src/main/java/com/flycast/emulator/AndroidStorage.java @@ -102,8 +102,6 @@ public class AndroidStorage { List comps = path.getPath(); if (comps.size() > 1) return DocumentsContract.buildDocumentUriUsingTree(uri, comps.get(comps.size() - 2)).toString(); - else - return ""; } catch (IllegalArgumentException e) { // Happens for root storage uri: // DocumentsContract: Failed to find path: Invalid URI: content://com.android.externalstorage.documents/tree/primary%3AFlycast