I've been trying to find the answer without success for this exception that is being thrown when I pick a file from the downloads folder on API 28, which ends up being cached as a fallback and retrieved the path nevertheless.
TL;DR: What do I need to fix this exception?
java.lang.SecurityException: Permission Denial: reading
com.android.providers.downloads.DownloadProvider uri
content://downloads/all_downloads/40 from pid=13467, uid=10091 requires
android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()
Things I've already tried so far:
Add this to the manifest file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name = "android.permission.ACCESS_DOWNLOAD_MANAGER"/>
and requesting Manifest.permission.WRITE_EXTERNAL_STORAGE
in runtime.