Calling device.connectGatt(appCtx, autoConnect, getCentralGattCallback());
where
device
is a discovered BLE device that was not paired (bonded) beforegetCentralGattCallback()
returns callback implementation that's not relevant in this context, we can assume it just logs callbacks
will pop up the system pair confirmation dialog (notifications, actually) 2 times in a row. Those dialogs are exactly the same, just pair and cancel buttons. Only after confirming the second one, callback's onConnectionStateChange
will be fired.
That's not the best user experience and I wonder if I should dig deeper into my code and find the root problem for this, or it's an Android bug?
Reproducible on:
Central: Pixel 4a, Android 12
Peripheral: Nonin 3230 Oximeter (also A&D Weight Scales and Blood Pressure Monitor wors the same way)
That's not the case for OnePlus 5T, Android 10 thought - just 1 pair confirmation is required here.