Android: Make the handling of SAF open modes more robust
This commit is contained in:
1 parent
6a4ac74ec4
commit
70df5446d3
4 files changed
+43
-25
No files matched your search
+3
-1
@@ -17,7 +17,9 @@ public class ContentHandler
|
||||
return DolphinApplication.getAppContext().getContentResolver()
|
||||
.openFileDescriptor(Uri.parse(uri), mode).detachFd();
|
||||
}
|
||||
catch (FileNotFoundException | NullPointerException e)
|
||||
// Some content providers throw IllegalArgumentException for invalid modes,
|
||||
// despite the documentation saying that invalid modes result in a FileNotFoundException
|
||||
catch (FileNotFoundException | IllegalArgumentException | NullPointerException e)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user