Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change pairing dialog appearance in 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:

Pairing dialog

The issues are:

  • 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.

  • "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.

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

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

like image 273
LoPoBo Avatar asked Oct 29 '22 11:10

LoPoBo


1 Answers

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.

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

like image 74
Francisco Durdin Garcia Avatar answered Nov 13 '22 04:11

Francisco Durdin Garcia