I'm trying to understand the permission needed when using (SAF) Storage Access Framework
to access files (in my case it's Internal storage, files which are not lying on External SD Card). From the documentation, I understand client is suppose to request permission to interact with files.
In the SAF, providers and clients don't interact directly. A client requests permission to interact with files (that is, to read, edit, create, or delete files).
However, I have also been reading a few articles (Link 1)(Link 2) which mentioned as below: (In my own words: Accessing storage without having user granting READ/WRITE permission)
- get away with READ/WRITE permissions on Android
- Accessing Storage Volume without Storage Permissions
In my case:
I use react-native-document-picker for choosing a file (operation does not perform any file changes, only READ), when the application on ANDROID deny the storage permission. I'm getting java.io.IOException: Permission denied
.
Issue goes away when (storage permission is allowed && Gallery was opened at least once in app). Meaning, if the user allow storage permission and continue opening Files. I will still get java.io.IOException: Permission denied
, unless both conditions are met.
Hence I'm confused if (SAF) really do not required READ/WRITE storage permission?