在AndroidManife.xml 中添加android
android:sharedUserId="",ui
能够将不一样的程序加入到同一个进程中,方便数据的共享。xml
但必需要知足一个条件,即:共享UserId的程序必须使用相同的签名。进程
在AndroidManifest.xml中声明get
android:sharedUserId="android.uid.system"后,it
意味着将本身的程序加入到了系统的进程中,同时也将得到极大的权限。io
遗憾的是该应用程序将没有权限读写SD卡。file
Processes that continue holding open fds on the sdcard a little after it is
requested to be unmounted will be killed so that it can unmount.
We don't want the system process to be able to access the sdcard to avoid
these kinds of issues (and just general security cleanliness), so that it
does not have permission to access it. 权限
The system user can not access the SD card, because if the SD card gets unmounted it may need to kill any processes that have files open on it and we don't want system processes being killed like that. If you want to access the SD card, you need to not use the system shared user ID.request
解决方法:
须要用到android:sharedUserId="android.uid.system"能够作成一个服务,
或者把SD卡操做的功能独立出去,作成一个服务。