Skip to content

Commit

Permalink
Merge pull request #349 from NordicSemiconductor/improvement/asset-path
Browse files Browse the repository at this point in the history
Add asset path support
  • Loading branch information
philips77 authored Aug 8, 2022
2 parents 0945d81 + 14b5488 commit 950837b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,9 @@ private InputStream openInputStream(@NonNull final String filePath, final String
*/
private InputStream openInputStream(@NonNull final Uri stream, final String mimeType, final int mbrSize, final int types)
throws IOException {
final InputStream is = getContentResolver().openInputStream(stream);
final InputStream is = stream.toString().startsWith("file:///android_asset/") ?
getAssets().open(stream.getPath().substring(15)) :
getContentResolver().openInputStream(stream);
assert is != null;
if (MIME_TYPE_ZIP.equals(mimeType))
return new ArchiveInputStream(is, mbrSize, types);
Expand Down

0 comments on commit 950837b

Please sign in to comment.