1

I want to write test file to SDCard with Android 11, I close selinux with "adb shell setenforce 0", but fopen() will give errno 13 error,how to fix it? Thanks.

wang
  • 51
  • 1
  • 5
  • Read about "Storage Scope" of Android 11, then: https://stackoverflow.com/questions/62782648/android-11-scoped-storage-permissions – emandt Jan 20 '22 at 10:57
  • But I want to write to sdcard in hal layer, not in app – wang Jan 21 '22 at 02:16

1 Answers1

0

With selinux as permissive, you also need to check if the HAL executable has appropriate permissions to be able to create a file in the destination path. Check username and group name for HAL executable and the destination path.

For example: if HAL executable has 'system' user, /data/<file-name.extn> can be used as destination which has both user and group as 'system'.