Reputation: 2443
This is under Android Kitkat/Lollipop with multiple account feature enabled. I created a service with the user id "system", and had an activity binding to the service. Then in different user account, I tried to have another activity binding to the same service (with the flag Context.BIND_AUTO_CREATE). I was hoping that the activity would be bound to the existing service with the user id "system". However, Android created a new service with the user id "u10_system". Why would this happen? Is it possible to bind to the existing service whose user id is "system"?
Edit: For the service, I had this attribute: android:singleUser="true". The service also has INTERACT_ACCROSS_USERS permission.
Upvotes: 4
Views: 2166
Reputation: 3088
What you see is the effect of a combination of sharedUserId
and singleUser
flags in AndroidManifest.xml. This is what I found to happen in Android 12 (so ~8y later, things might have been different in Lollipop...):
sharedUserId:system
&& singleUser:true
sharedUserId:system
singleUser:true
Upvotes: 0