Googles 写道有一个 different value of the ANDROID_ID for different users .
In O, Android ID (Settings.Secure.ANDROID_ID or SSAID) has a different value for each app and each user on the device.
如果我执行 Google SignIn 意味着什么在一个应用程序中。确切地说:该设备在用户“A@google.com”下运行。用户在其设备上拥有帐户“A@google.com”、“B@google.com”、“C@google.com”。
当用户在“A@google.com”下运行设备并在安装应用程序后首次登录时,他将看到一个包含可能帐户的弹出窗口。假设他选择“A@google.com”。选择将保存在应用程序存储数据中。如果他清理数据并重新启动应用程序,他将再次弹出此帐户,理论上他可以选择另一个帐户。 假设他现在在登录时选择了另一个帐户“B@google.com”,因此他的设备仍以“A@google.com”运行,但他使用“B@google.com”登录到应用程序。那么 ANDROID_ID 是什么?来自 A 还是来自 B 的 ANDROID_ID? (本人没有安卓8的设备,无法自行查看)
最佳答案
我认为您混淆了由 AccountManager 管理的帐户和用户,由 UserManager 管理.
Users are different from accounts, which are managed by AccountManager. Each user can have their own set of accounts.
我的猜测是 ANDROID_ID
取决于 user serial number
从您提供的链接:
The ANDROID_ID value won't change on package uninstall/reinstall, as long as the package name and signing key are the same. Apps can rely on this value to maintain state across reinstalls.
在您的情况下,如果应用程序的数据被清除,应用程序 ID、签名和用户是相同的,因此 ANDROID_ID
不应更改。
关于Android 8,登录时每个用户的 ANDROID_ID 值不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53044381/