temporary permission for the files that user choose breaks because decodeURIComponent
The temporary permission is indexed by Uri, process id and user id and this is where system breaks.
The user selected file has an encoded uri for example,
content://com.android.providers.downloads.documents/document/msf%3A6179
In the pdf preview library, the uri is decoded into
"content://com.android.providers.downloads.documents/document/msf:6179"
This coding break the entire scoped permission system.