1

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 ?

sdabet
  • 18,360
  • 11
  • 89
  • 158
  • 1
    Removable micro sd cards are read only since Android 4 Kitkat. (Except for an app soecific dir). Use SAF if you want write access. On primary storage you have no access since Android 11. – blackapps Dec 13 '21 at 10:45
  • @blackapps Is it possible, using SAF, to recursively copy a folder into another app's external storage ? – sdabet Dec 13 '21 at 11:14
  • I suggested to use saf. So yes. In the whole micro sd card. Only Android 11 breaks it. – blackapps Dec 13 '21 at 11:17

0 Answers0