Report errors with Bluetooth pairing keys
In multi-boot setups, using one Bluetooth device (MAC) and many userspace setups, it is very frequent that a Linux partition "forgets" the Bluetooth keys set by the other partitions or OSs, and devices require re-pairing when moving between partitions.
There is no clear workaround to this, as synchronizing the keys would need deep inspection of "foreign" filesystems, which is of course unpractical. However, when connecting to a previously paired Bluetooth device, but with wrong keys for some reason, G-C-C will report the device as being connected for some seconds, and automatically disconnected afterwards. This can be frustrating and took me a long time to figure out the cause and the solution (removing the paired devices and re-adding those)
There could be several alternatives:
- When pairing fails due to mismatched keys, show a somewhat SSH-like dialog saying "Keys have changed", with the old and new keys, and allowing the user, after showing proper disclaimers, to update the keys to the current one and re-pair it. I am not sure if this is even technically feasible.
- When pairing fails due to mismatched keys, show an error dialog saying that the keys are wrong, and the user might need to remove and re-pair the device.
- More simply, report any kind of pairing error (other than timeouts perhaps) rather than failing silently