如何对同一个应用的Android个服务进行私有数据目录访问限制?

How to impose private data directory access restrictions for Android services of the same app?

我想 运行 一个 Android-app 和两个使用 'service' 标签的服务。

<service android:name=".Service1" android:process=":myprocess1"></service> 
<service android:name=".Service2" android:process=":myprocess2"></service> 

内部数据目录类似于下面的内容

 com.my.android.app
 -> data
    -> service1dir
    -> service2dir

PS:在模拟器中它托管在 /data/user/0/com。my.android.app

调用 android-app 对 'data' 目录具有完全权限。 是否可以将 'service1dir' 目录的权限限制为 'service1'、'service2dir' 目录 'service2' 服务?

通过这样做,我可以在不设置 android:isolatedProcess="true" 的情况下实现数据存储和 inet 的隔离。 如果我将服务作为一个独立的进程,这两个服务都没有 inet/data/storage 权限。

参考Android, service, isolatedprocess, define permission

Is it possible to restrict permissions for the 'service1dir' directory to 'service1', 'service2dir' directory 'service2' services?

不,抱歉。