Implications of Android multiple user support (new in 4.2) for server side data model (e.g. android_id)

StackOverflow https://stackoverflow.com/questions/13408349

  •  29-11-2021
  •  | 
  •  

Question

Google has just released Android 4.2, which includes support for multiple user profiles on a single device: http://developer.android.com/about/versions/android-4.2.html#MultipleUsers.

Google says that this will be transparent to apps, but I think it could have an impact on the data model used to identify devices, users, and installations.

One issue is the use of android_id. The advice on the linked page above suggests identifying a device by one of the methods other then android_id, but I believe that android_id is very widely used for this purpose.

My main question is - does each user profile have its own android_id, and what are the implications?

A new android_id gets generated when a new OS is installed or when a hard reset is done - perhaps a new one will be generated when a new user profile is created (this is question #1)? I think probably not, so then an app could be installed multiple times for the same android_id - I think this could muck with the server-side data model for some apps.

Either way, depending on how you identify a device, you could now find that a particular app can have multiple installations on a single device.

Another issue is users. Presumably each profile can have any number of Google accounts, but a single Google account must be associated with the play store in each profile. I think it is also possible that your app could have multiple simultaneous installations with the same device (by android_id) AND the same user. I think that a common use of the multiple profiles feature will be for a single user to have home and work profiles on their phone - typically using different Google accounts, but in some case they could have the same Google account in each profile (e.g. so they don't have to pay for stuff twice).

Side Note
Here is a similar discussion of ANDROID_ID on the new ARC platform (Android on Chrome). Take care - the behavior on ARC is not the same as on Android.

Était-ce utile?

La solution

(No one answered my question, but I've now had a chance to test with 4.2 myself.)

The answer is that each profile has its own android_id.

Come to think of it, this probably makes the most sense and will cause the least problems. This should cause most systems to see the different profiles on a device as different devices - which shouldn't really be a problem. The only problem would be systems that correctly identified a device, eg. based on wifi or bt mac address, or serial number or IMEI, and then expected that multiple android_id's on that single device represented sequential OS installations on that device. (Rather perversely, it will be safer to be wrong.)

Autres conseils

Yes, each user profile has its own ANDROID_ID. This is now documented here:

Note: When a device has multiple users (available on certain devices running Android 4.2 or higher), each user appears as a completely separate device, so the ANDROID_ID value is unique to each user.

Beware though that manufacturers have been known to botch their implementation of ANDROID_ID. For example, the Motorola Droid2 returned the same ANDROID_ID value for every device. For that reason, relying on the ANDROID_ID to uniquely identify user profiles or devices may be unreliable.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top