Write on SD card as DPC/device owner

182 Views Asked by At

My app is a DPC (device policy controller), setup as device owner on an Android 8.0.0 (API 26) device. And it needs read/write access to another app's external storage directory (to do some rsync).

It works well on the primary/emulated external storage, but not on the secondary external storage provided by an SD card.

In other words, the app can read/write on any /storage/emulated/Android/data/<package>/files folder without restriction but cannot read/write on /storage/<SD_CARD_ID>/Android/data/<package>/files.

Why is the behavior different between both external storages ? Is there any way to grant read/write permission to the DPC ?

0

There are 0 best solutions below