admin管理员组

文章数量:1418675

I am working on a project that includes both, an Android app and a custom AOSP built. Inside of the app that is running as a regular user (in this case user with id 10), I am downloading a file to Environment.getExternalStoragePublicDirectory()) which I want to access from a privileged platform service running as user 0. Reading files from other locations (e.g. /data/local/temp) inside of the platform service works but as soon as I am trying to access a user directory, I get permission denied because of linux ACLs (EACCES exception).

Additional facts:

  • Android Version 15
  • Kotlin

Any idea how I can achieve downloading the files with a regular user and then passing them to the system user inside of the platform?

I tried:

  • FileProviders -> obviously not working because it is intended to share files between two apps running as the same user
  • hardcoding some sdcard path -> not working because android studio complains that you should not do that

本文标签: kotlinAndroid multiuser downloaded file access across usersStack Overflow