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()包当前请求用户同意以跨配置文件交互的功能。 如果true,可以通过 <a0/> 获取用户同意。 然后,包可以侦听 #ACTION_CAN_INTERACT_ACROSS_PROFILES_CHANGED 广播。

适用于 . 的 android.content.pm.CrossProfileApps.canInteractAcrossProfiles()Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于