语言

CrossProfileApps.CanInteractAcrossProfiles 方法

定义

返回调用包是否可以跨配置文件进行交互。

[Android.Runtime.Register("canInteractAcrossProfiles", "()Z", "GetCanInteractAcrossProfilesHandler", ApiSince=30)]
public virtual bool CanInteractAcrossProfiles();
[<Android.Runtime.Register("canInteractAcrossProfiles", "()Z", "GetCanInteractAcrossProfilesHandler", ApiSince=30)>]
abstract member CanInteractAcrossProfiles : unit -> bool
override this.CanInteractAcrossProfiles : unit -> bool

返回

如果调用包可以跨配置文件进行交互,则为 true。

特性

注解

返回调用包是否可以跨配置文件进行交互。

具体而言,返回以下内容是否全部为 true:<ul><li>#getTargetUserProfiles() 返回呼叫用户的非空列表。</li li><>用户以前已同意对呼叫包进行跨配置文件通信。</li li><>默认情况下,呼叫包已由 OEM 允许列表,或者已由管理员android.app.admin.DevicePolicyManager#setCrossProfilePackages(ComponentName, Set)通过显式允许列表。 </li></ul>

如果 false,可以检查 #canRequestInteractAcrossProfiles()包当前请求用户同意以跨配置文件交互的功能。 如果,可以通过 <a0/> 获取用户同意。 然后,包可以侦听 #ACTION_CAN_INTERACT_ACROSS_PROFILES_CHANGED 广播。

Java文档android.content.pm.CrossProfileApps.canInteractAcrossProfiles()。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于