[BRLTTY] Repeated Bluetooth pairing request on Android

Robert Pösel robyer at seznam.cz
Tue Mar 6 04:15:25 EST 2018


Hi,

while reading Android documentation I come to this recommendation:

"Note: You should always call cancelDiscovery() to ensure that the 
device isn't performing device discovery before you call connect(). If 
discovery is in progress, then the connection attempt is significantly 
slowed, and it's more likely to fail." 
(https://developer.android.com/guide/topics/connectivity/bluetooth.html)

I don't see any call to BluetoothAdapter.cancelDiscovery() so it might 
be good idea to add it? On the other hand, since you are calling the 
connect() method repeatedly every few seconds, it would mean that 
bluetooth discovery will never have a chance to finish (as cancelling it 
has global effect for whole system). So unless this automatic repeated 
connection will be rewritten somehow, current way without 
cancelDiscovery() is perhaps okay?

Btw what about power consumption and battery life regarding these 
repeated connection attempts? Do you know if it has any impact or is it 
"safe" to use this way?

Thanks,
Robert


More information about the BRLTTY mailing list