Reputation: 3162
I'm building an Android Automotive system application that doesn't include any UI.
This service acts as a local backend/proxy on the device waiting for requests from other applications, making the desired action and return the needed data as a response.
Must of the interaction between the service and the other applications are handled using AIDL.
Two questions:
singleUser=true
, but it didn't help, two process are still created for each user.PackageManager.setApplicationEnabledSetting()
, like Google suggested here. The problem is that when other application is trying to communicate using an AIDL service I'm getting the error below. Worth to mention that each service is marked with android:exported="true"
and android:singleUser="true"
. From what I know marking the service as singleUser=true
should make all the calls to be routed to the service running on the system user.
Am I missing something with the current implementation?ActivityManager: Unable to start service Intent { act=com.companyName.appName.services.serviceName pkg=com.companyName.appName } U=12: not found
Upvotes: 2
Views: 518
Reputation: 76799
One can bind with Context.bindServiceAsUser()
.
This depends on permission android.permission.INTERACT_ACROSS_USERS
and both packages must have the same signature. See the documentation: Building Multiuser-Aware Apps
.
<permission
android:name="android.permission.INTERACT_ACROSS_USERS"
android:protectionLevel="signature"/>
Upvotes: 0