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)
This commit is contained in:
parent
35b7be3905
commit
8ba5e05421
|
@ -102,8 +102,6 @@ public class AndroidStorage {
|
|||
List<String> 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
|
||||
|
|
Loading…
Reference in New Issue