Is READ_WRITE_PERMISSION still necessary?

The wiki and the API sample app say my app needs to dynamically request READ_WRITE_PERMISSION to write to the AnkiDroid database. However, in my tests everything seems to work fine without requesting the permission. This is true whether AnkiDroid is installed on the user’s phone before my app or after.

After a bit of digging, I found that this is likely due to the AnkiDroid’s change to using ContentProvider in version 2.16. This was over two years ago, but the wiki and sample still mention the permission thing as a requirement. So I wanted to ask here to confirm: is it that those resources are out of date, or is it that it IS actually still required and my tests are missing something?

It’s been a while since i worked with the CardContentProvider, but at the time I did have to set/request the permission in the calling app to use it. And looking at the source, it does seem to check for it:

NB: this is only if you’re interacting with the db via the content provider

Interesting. Thanks for the lead. Reading through the call sites of that function, it looks like if I have the READ_WRITE_PERMISSIONS line in my manifest (which I do) then I don’t need the dynamic permission for queries or inserts, but do need it only for updates and deletes?