I’m facing with the following problem:
I created application where user can keep his own private files and I need to pass these files to default viewers (PDFViewer for example).
The problem is that files are private and PDFViewer has no access to my files. I solved this issue using approach that is used in email clients – I created content provider where I return ParcelFileDescriptor.
Now it works great, but I faced with new problem – documentation says I need to use Intent.FLAG_GRANT_READ_URI_PERMISSION flag when I pass URI to PDFViewer, but in my case it works well even without this flag and even with “android:grantUriPermissions=”false””
Looks like now my files become not private because of content provider.
How to make it honor Intent.FLAG_GRANT_READ_URI_PERMISSION flag?
Found the problem – I forgot to add “android:readPermission” flag to my provider