mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-06 08:09:19 +00:00
Android: Make the handling of SAF open modes more robust
This commit is contained in:
parent
6a4ac74ec4
commit
70df5446d3
4 changed files with 43 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue