Skip to content

Commit

Permalink
fix(android): getInputStream around "content://" paths (NativeScript#…
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug authored Jan 19, 2024
1 parent 3a0afdb commit 41759c1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ public long getLastModified() {

private InputStream getInputStream(Context context, Uri uri) throws Exception {
if (Build.VERSION.SDK_INT >= 19) {
if (DocumentsContract.isDocumentUri(context, uri)) {
return context.getContentResolver().openInputStream(DocumentFile.fromSingleUri(context, uri).getUri());
}
if (isExternalStorageDocument(uri)) {
File file = getFile(context, uri);
return new FileInputStream(file);
}
if (DocumentsContract.isDocumentUri(context, uri)) {
return context.getContentResolver().openInputStream(DocumentFile.fromSingleUri(context, uri).getUri());
}
}
return context.getContentResolver().openInputStream(uri);
}
Expand Down

0 comments on commit 41759c1

Please sign in to comment.