I'm having trouble helping out a user of my plugin (PdfToText).
With the plugin you can select a Pdf file which will be loaded as text in Tasker.
The configuration screen has a test button which reads and shows the content of the file just fine. Also, when this user adds a "Read File" action to this specific file Tasker is able to read the (raw) content.
However, when the user tries to
execute the PdfToText task it results in the error:
Permission Denial: opening
provider com.android.provider.media.MediaDocumentsProvider from ProcessRecord …
requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
The code I use to obtain the file uri is
val intent=Intent(Intent.ACTION_OPEN_DOCUMENT).apply{
addCategory(Intent.CATEGORY_OPENABLE)
type="application/pdf"
}
startActivityForResult(intent,PICK_PDF_FILE)
As far as I know this issue occurs only on Android 11 (API 30) but I'm unable to reproduce this on any VM.
I'm guessing there is something wrong with the way I obtain the file uri and use it in the Tasker task. Would a different way of obtaining the file uri be the solution and if so, what would be the correct way?
Any help is appreciated very much.
--
You received this message because you are subscribed to the Google Groups "Tasker - Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taskerdev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/taskerdev/9e05a6b9-c7d4-4091-94f0-0aed2b11fb57n%40googlegroups.com.