简体   繁体   English

如何使用非启动器应用程序启用信息亭模式?

[英]How to enable kiosk mode with non-launcher app?

In my custom DPC app (which is configured as device owner), I would like to set a third-party app in kiosk mode.在我的自定义DPC 应用程序(配置为设备所有者)中,我想将第三方应用程序设置为自助服务终端模式。

I did some tests with DevicePolicyManager.addPersistentPreferredActivity() but it seems to only work if the target app is a launcher, ie if the provided component is an activity that supports the HOME and DEFAULT intent categories.我用DevicePolicyManager.addPersistentPreferredActivity()做了一些测试,但它似乎只在目标应用程序是启动器时才有效,即如果提供的组件是支持 HOME 和 DEFAULT 意图类别的活动。 But I need it to work with any app.但我需要它与任何应用程序一起使用。

Google DPC Android Device Policy can make it, as explained in "Apps that don't support lock task mode" by providing only the package name (not the full activity component name) in the persistentPreferredActivities section of the policy. Google DPC Android Device Policy可以通过在策略的persistentPreferredActivities部分中仅提供程序包名称(而不是完整的活动组件名称)来实现,如“不支持锁定任务模式的应用程序”中所述。 Therefore I assume that it is possible to do it in my DPC, but how ?因此,我认为可以在我的 DPC 中做到这一点,但如何做到?

As already mentioned, there is no official way to lock an app into kiosk mode with a policy when lock mode is not supported.如前所述,当不支持lock mode时,没有官方方法可以通过策略将应用程序锁定到信息亭模式。

the addPersistentPreferredActivity() method only sets the default handler for these intents but they can also be overridden. addPersistentPreferredActivity()方法仅为这些意图设置默认处理程序,但它们也可以被覆盖。

我找到的解决方案是将 DPC 设置为默认启动器,并从 DPC 自动启动第三方应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM