CrossProfileApps.CanRequestInteractAcrossProfiles 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回调用包是否可以请求将用户导航到相关设置页面,以请求用户同意跨配置文件交互。
[Android.Runtime.Register("canRequestInteractAcrossProfiles", "()Z", "GetCanRequestInteractAcrossProfilesHandler", ApiSince=30)]
public virtual bool CanRequestInteractAcrossProfiles();
[<Android.Runtime.Register("canRequestInteractAcrossProfiles", "()Z", "GetCanRequestInteractAcrossProfilesHandler", ApiSince=30)>]
abstract member CanRequestInteractAcrossProfiles : unit -> bool
override this.CanRequestInteractAcrossProfiles : unit -> bool
返回
如果调用包可以请求跨配置文件交互,则为 true。
- 特性
注解
返回调用包是否可以请求将用户导航到相关设置页面,以请求用户同意跨配置文件交互。
如果 true,可以通过获取 #createRequestInteractAcrossProfilesIntent()导航意向。 然后,包可以侦听 #ACTION_CAN_INTERACT_ACROSS_PROFILES_CHANGED 广播。
具体来说,返回以下内容是否全部为 true:<ul><li>UserManager#getProfileIdsExcludingHidden(int) 为呼叫用户返回至少一个其他配置文件。</li><>该调用应用在其清单中已请求android.Manifest.permission.INTERACT_ACROSS_PROFILES。</li><>呼叫应用不是呼叫用户的配置文件组中的配置文件所有者。</li></ul>
请注意,为了使用户能够授予许可,请求包必须由管理员或 OEM 列入允许列表,并安装在其他配置文件中。 如果不是这种情况,用户将显示一条消息,说明他们为何无法授予同意。
请注意,如果给定的返回值为 true,则可授予用户同意。 可以检查 #canInteractAcrossProfiles()包当前跨配置文件交互的功能。
Java文档android.content.pm.CrossProfileApps.canRequestInteractAcrossProfiles()。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。