最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

kotlin - Android multi-user downloaded file access across users - Stack Overflow

programmeradmin0浏览0评论

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
发布评论

评论列表(0)

  1. 暂无评论