简体   繁体   English

蓝牙配对对话框未在屏幕固定模式下显示

[英]Bluetooth pairing dialog not showing up in Screen Pinning mode

I'm writing an enterprise inspired app based on Device Policy Manager.我正在编写一个基于设备策略管理器的企业级应用程序。 The app will enable kiosk mode on the device so only one app will be in the foreground & the user won't be able to get out of the app.该应用程序将在设备上启用信息亭模式,因此只有一个应用程序在前台,用户将无法退出该应用程序。

My app whitelists the particular app that's going to be in the foreground.我的应用程序将要在前台运行的特定应用程序列入白名单。 Everything so far is working great except that when the device is in Kiosk mode, the system dialogs, for example, Bluetooth device pairing dialog and USB accessory permission dialog don't appear on top of the pinned app.到目前为止,一切都运行良好,除了当设备处于 Kiosk 模式时,系统对话框(例如,蓝牙设备配对对话框和 USB 配件许可对话框)不会出现在固定应用程序的顶部。

I couldn't find any api that would enable such system dialogs to appear while kiosk mode is in action.我找不到任何可以在自助服务终端模式运行时显示此类系统对话框的 API。

Google added some new apis in Android 9 that let you know that but since my app will be running on devices <= Android Oreo, I can't utilize those apis. Google 在 Android 9 中添加了一些新的 api,让您知道,但由于我的应用程序将在设备上运行 <= Android Oreo,我无法使用这些 api。

Following api is using to whitelist an app to go in Kiosk Mode,以下 api 用于将应用程序列入白名单以进入 Kiosk 模式,

public void setLockTaskPackages (ComponentName admin, 
                String[] packages)

and then the screen pinned app calls startLockTask() to have full affect of kiosk mode but then system dialogs stop appearing as mentioned above.然后屏幕固定的应用程序调用startLockTask()以完全影响 kiosk 模式,但随后系统对话框停止出现,如上所述。

Is there any other api that would let the system dialogs to show up?是否有任何其他 api 可以让系统对话框显示? Any pointers/work arounds would be really appreciated任何指针/解决方法将不胜感激

I'm currently developing an enterprise app that has the same issue.我目前正在开发具有相同问题的企业应用程序。 My temporary solution has been to unlock the application while I'm expecting to receive the Bluetooth pairing dialog, and then lock the app once the connection has been set up.我的临时解决方案是在我期望收到蓝牙配对对话框时解锁应用程序,然后在建立连接后锁定应用程序。

So far, this is the only solution I've found to work.到目前为止,这是我发现的唯一可行的解​​决方案。 If you manage to find a solution, please let me know.如果您设法找到解决方案,请告诉我。 It's been a frustrating couple of months trying to fix this.试图解决这个问题已经令人沮丧了几个月。

我不得不将“com.android.settings”添加到我的 LockTaskPackages 列表中。

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

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