I have an application that contains a service component and which is defined as android:singleUser="true"
in Android manifest.
<service
android:name=".Servicename"
android:exported="true"
android:singleUser="true" />
I have a strong use-case to keep this as a singleton component (singleUser). At the same time, there will be multiple clients for our application. These clients bind to our service and access the APIs exposed via binder. However, as the service component in our application is singleton (singleUser), it restricts the clients to be singleUser again or to use INTERACT_ACROSS_USERS_FULL
permission to bind to our service.
We want to establish a connection between the clients and our application without client being singleUser or using INTERACT_ACROSS_USERS_FULL
permission (it has signature protectionLevel). Therefore, I’m thinking to create a new service component (bound service) which will not be singleUser and let the clients bind to this new service. This new service in turn will connect to our singleUser service and call the API requested by clients (basically want to keep this service as a proxy). This will just require INTERACT_ACROSS_USERS
permission and it’s protectionLevel is not signature so I’m okay with it.
Is this possible to implement and any things we need to consider while building this model? I’m clueless how to respond back to the clients from singleUser service because of the proxy service in place also.