在Android中更改配对对话框的外观 [英] Change pairing dialog appearance in Android

查看:51
本文介绍了在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版本和/或制造商而有所不同.屏幕截图来自具有Android 7的Nexus 5X)

(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中更改配对对话框的外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆