Android 中的bindServiceAsUser() 方法是什么?

zor*_*oro 5 android android-context bindservice

我无法理解该bindServiceAsUser()方法是用来做什么的。有人可以解释一下吗?谷歌搜索似乎没有多大帮助。

    public boolean bindService(Intent intent, ServiceConnection connection, int flags) {
    return mContext.bindServiceAsUser(intent, connection, flags, UserHandle.OWNER);
}
Run Code Online (Sandbox Code Playgroud)

Ves*_*sko 1

我从来没有觉得有必要使用bindServiceAsUser(),但 Android 文档对此是这么说的:

与 bindService(android.content.Intent,android.content.ServiceConnection,int) 相同,但具有显式的 userHandle 参数,供系统服务器和其他多用户感知代码使用。

Android 4.2(API:17)中添加了多用户支持,请在此处阅读。据我了解,它将主要由设备制造商使用,例如为企业界发布特殊设备。我发现的最适合多用户的文档是文档,以及其中的所有引用链接。