中的配对对话框外观

中的配对对话框外观

本文介绍了更改 Android 中的配对对话框外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个与 BLE 设备(我们也生产)配对的 Android 应用程序,但我们在默认的 Android 配对对话框中遇到了一些问题:

We have an Android app that pairs to a BLE device (which we also produce) and we are having some issues with the default Android pairing dialog:

问题是:

  • 我们的设备不需要访问联系人或通话记录.是否可以删除该选项?无论是否选中该框,配对和我们的功能都将起作用,但我们的客户认为他们必须选中它,并对我们为什么需要该信息表示担忧.此选项似乎已在 Android 6 中添加.

  • Our device does not need access to contacts or call history. Is it possible to remove that option? The pairing and our functionality will work regardless of whether the box is checked or not but our customers think they have to check it and have expressed concerns as to why we need that information. This option seems to have been added in Android 6.

键入配对代码,然后按 Return 或 Enter"没有任何意义,因为没有配对代码和输入字段.删除/更改此文本会很好.

"Type the pairing code then press Return or Enter" doesn't make any sense as there is no pairing code and no input field. It would be nice to get rid of/change this text.

是否可以通过应用程序(最好)或通过更改 BLE 设备来调整对话框?

Is it possible to tweak the dialog via the app (preferably), or possibly by changes in the BLE device?

(我意识到对话框可能因不同的 Android 版本和/或制造商而异.屏幕截图来自 Nexus 5X 和 Android 7)

(I realize that the dialog might differ with different Android versions and/or manufacturers. The screenshot is from Nexus 5X with Android 7)

推荐答案

目前您无法在应用级别自定义对话框的外观,您唯一能做的就是启用/禁用允许访问联系人或使用BLUETOOTH_PRIVILEGED 权限自动接受对话和配对请求.

At the moment you can't customize the apperance of the dialog in the app level, the only thing you could do is enable/disable the checkbox for allow the access to contacts or automatically accept the dialog and the pairing request using theBLUETOOTH_PRIVILEGED permission.

但如果您的应用是第三方应用(非系统应用),则不能使用此权限.要了解更多信息,请参阅 Android API:BLUETOOTH_PRIVILEGED

But you can't use this permission if your app is a third party app (non-system app). To learn more, see Android API: BLUETOOTH_PRIVILEGED

这篇关于更改 Android 中的配对对话框外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 12:50