@Cahoots — your AirPods symptom (having to forget and re-pair) matches what I describe below; please check whether “Send incoming pairing requests to AppSupport” is enabled on your phone.
Update: second and more serious cause found — with “Send incoming pairing requests to AppSupport” enabled, the headset’s own reconnection is handed to the Android stack, which destroys the pairing
Since the first post, the headset lost its pairing three times (25/11, night of 28→29/11, and this morning). Each time it had to be removed and paired again. I traced it this morning, and it is not a headset problem: the same headset never loses its pairing with Android phones. The cause is on the phone side, in the AppSupport Bluetooth bridge.
Short version
- Setting: Settings > Bluetooth > Send incoming pairing requests to AppSupport (
PairTargetAppSupport=true in /etc/appsupport-bridge-bt.conf, enabled on my device).
- When the headset is switched on, it calls the phone by itself, which is the normal way a bonded headset reconnects.
appsupport-bridge-bt forwarded that incoming connection to the Android Bluetooth stack instead of BlueZ, although the headset is paired with Sailfish (BlueZ) only.
- Android does not know the headset and has no link key, so authentication fails with
HCI_ERR_KEY_MISSING.
- After that failure the headset deletes its link key. From then on, every connection attempt from BlueZ fails with
br-connection-key-missing until the device is removed and paired again.
- With the setting switched off, the same power-on is handed to BlueZ, the headset reconnects by itself in 11 s and keeps its key.
Setup
| Item |
Value |
| Phone |
Jolla Phone 2026 (JP2601), Sailfish OS 5.2.0.22 |
| BlueZ |
bluez5-5.87+git3-1.17.1.jolla, controller hci1 |
| Bridge |
appsupport-bridge-bt-0.9.8-1.6.1.jolla |
| AppSupport |
running, com.android.bluetooth active |
| Headset |
generic “V618” neckband (model ZL014), BR/EDR only, A2DP + HFP + AVRCP, address 88:05:E7:20:6B:B7 |
| Headset pairing |
Sailfish only: present in /var/lib/bluetooth/<adapter>/88:05:E7:20:6B:B7/, absent from Android’s bt_config.conf |
| Workaround from the first post |
installed (adapter forced Connectable=true, reconnect of trusted audio devices on Bluetooth power-on) |
Behavioural analysis, step by step
1. The headset loses its pairing; the phone keeps it
This morning at 10:58 I checked the state before the test, with the headset switched off:
Adapter1.Powered = true
Adapter1.Connectable = true (forced by the workaround)
Device1.Paired = true
Device1.Trusted = true
Device1.Connected = false
link key in /var/lib/bluetooth/…/88:05:E7:20:6B:B7/info : present, unchanged since the pairing of 00:47
The headset was switched on at about 10:59. It announced “power on” but never connected. At 11:00:14 I asked BlueZ to connect:
busctl call org.bluez /org/bluez/hci1/dev_88_05_E7_20_6B_B7 org.bluez.Device1 Connect
→ br-connection-key-missing
bluetoothd (debug logging on):
11:00:14 src/adapter.c:bonding_attempt_complete() hci1 bdaddr 88:05:E7:20:6B:B7 type 0 status 0xe
11:00:14 src/device.c:device_bonding_failed() status 14
11:00:14 src/profile.c:record_cb() Unable to get hfp_ag SDP record: Input/output error
11:00:14 src/adapter.c:dev_disconnected() Device 88:05:E7:20:6B:B7 disconnected, reason 2
The phone still had its link key, but the headset refused it: the headset had forgotten the pairing. The same thing happened on 25/11 and on the night of 28→29/11 (bonding status 0x0e at 00:45).
2. No other device paired with the headset in between
To rule out the usual cause (the headset keeps only a few pairings and overwrites the oldest), I checked every device that could have paired with it: my Linux laptop, the Android side of the phone (/home/.appsupport/instance/defaultuser/data/misc/bluedroid/bt_config.conf) and the TV. None of them knows 88:05:E7:20:6B:B7. The headset has also never had this problem with Android phones. So the pairing is destroyed by something that happens on the Jolla.
3. What actually happened at 10:59: the Android stack received the headset
The AppSupport logcat (lxc-attach --lxcpath=/tmp/appsupport -n defaultuser -- /system/bin/logcat -d -b all) shows that the headset’s connection at power-on was handled by Android, not BlueZ:
10:59:00.336 I/droid.bluetooth: classic_impl.h:674 on_role_change: Role change for xx:xx:xx:xx:6b:b7 with no matching connection (new role: CENTRAL(0x00))
10:59:00.352 I/bt_bta_dm: bta_dm_act.cc:723 bta_dm_acl_up: Acl connected peer:xx:xx:xx:xx:6b:b7 transport:BT_TRANSPORT_BR_EDR handle:50
10:59:00.353 W/BluetoothRemoteDevices: aclStateChangeCallback: device is NULL, address=XX:XX:XX:XX:6B:B7, newState=0
10:59:00.366 I/droid.bluetooth: remote_name_request.cc:118 actually_start_remote_name_request: Starting remote name request to xx:xx:xx:xx:6b:b7
10:59:00.395 I/smp: smp_l2c.cc:281 smp_br_connect_callback: BDA:xx:xx:xx:xx:6b:b7 pairing_bda:00:00:00:00:00:00, connected:false
10:59:00.597 W/bt_btm_sec: btm_sec.cc:3910 btm_sec_disconnected: Got uncommon disconnection reason:HCI_ERR_KEY_MISSING handle:0x0032
10:59:00.597 I/bluetooth-a2dp: btif_av.cc:863 btif_av_find_peer: Unable to find the peer xx:xx:xx:xx:6b:b7
Meanwhile on the Sailfish side, the journal shows only one bridge line and no connection at all in bluetoothd:
10:59:00.404 appsupport-bridge-bt: unexpected remote name request complete; sending to BlueZ
My reading of the sequence, in under 300 ms:
- The headset pages the phone (incoming HCI Connection Request).
- The bridge forwards the request to AppSupport. Android accepts the ACL link and takes the central role (
bta_dm_acl_up).
- Android has no record of the device (
device is NULL).
- The headset starts authentication with the key it still holds. The controller asks the host for the link key, and Android has none, so it replies negatively.
- The link drops with
HCI_ERR_KEY_MISSING (HCI 0x06, PIN or Key Missing).
- The headset concludes that the phone has dropped the pairing and deletes its own key. Many headsets do this; I cannot see inside the headset, but the result is certain: from 11:00 on it refuses the key BlueZ still holds.
This also explains why the bonded headset never reached bluetoothd in the first post’s “case 1”: it was not only the Connectable=false problem. At least sometimes, the call was going to the wrong stack.
4. Same test with the setting off: the headset reaches BlueZ and keeps its key
After pairing again (11:04, new key), I switched the setting off. The method is the same D-Bus call the Settings switch uses, and it persists to the config file:
busctl call com.jolla.appsupport.bridge_bt /com/jolla/appsupport/bridge_bt \
com.jolla.appsupport.bridge_bt changePairTargetToAppSupport b false
isAppSupportThePairTarget → false ; /etc/appsupport-bridge-bt.conf → PairTargetAppSupport=false
Then I switched the headset off (11:14:56) and on again:
11:15:02.851 appsupport-bridge-bt: unexpected connection completed event, falling back to bdaddrs
11:15:02.910 bluetoothd: src/adapter.c:connected_callback() hci1 device 88:05:E7:20:6B:B7 connected eir_len 11
11:15:02.982 bluetoothd: profiles/audio/a2dp.c:confirm_cb() AVDTP: incoming connect from 88:05:E7:20:6B:B7
11:15:03.065 bluetoothd: src/profile.c:ext_confirm() incoming connect from 88:05:E7:20:6B:B7
11:15:03.066 bluetoothd: src/profile.c:ext_auth() 88:05:E7:20:6B:B7 authorized to connect to hfp_ag
11:15:03.071 bluetoothd: hfp_ag state changed: connecting -> connected
11:15:03.454 bluetoothd: a2dp-sink state changed: disconnected -> connected
The headset itself made the connection (all the incoming connect lines), BlueZ handled it, HFP, A2DP and AVRCP came up in about 1 s, and the link key was unchanged afterwards. Nothing appeared in the Android logcat for this address.
5. Timeline
| Time (29/11) |
Setting |
Event |
Result |
| 00:47 |
on |
headset paired again from Sailfish |
key stored on both sides |
| 01:25 |
on |
headset off/on, adapter forced connectable |
reconnected by itself in 14 s through BlueZ (first post) |
| 10:58 |
on |
checks: paired, trusted, connectable, key present |
— |
| 10:59:00 |
on |
headset switched on, call forwarded to Android |
HCI_ERR_KEY_MISSING, headset deletes its key |
| 11:00:14 |
on |
Connect() from BlueZ |
br-connection-key-missing |
| 11:04 |
on |
removed and paired again |
new key |
| 11:13 |
off |
changePairTargetToAppSupport false |
persisted |
| 11:15:02 |
off |
headset off/on |
call handled by BlueZ, reconnected in 11 s, key kept |
At 01:25 the setting was on and the call still reached BlueZ. So with the setting on, where the call goes seems to depend on the bridge’s internal state, and the failure is intermittent rather than systematic. A likely explanation is that the bridge still had the device in a short-lived “recent BlueZ connection” list after the 00:47 pairing and the 01:09 connect, but I have not proven this. That intermittency would explain why the pairing survives for hours or a day and then suddenly disappears.
6. What the bridge does with an incoming connection
This part comes from the bridge’s own log messages and its D-Bus interface, plus a quick look at the binary’s strings and call flow. Take it as a strong hint, not a source-code reading.
For an incoming HCI Connection Request (event 0x04), the bridge appears to choose in this order:
- the address belongs to a connection BlueZ itself started → BlueZ;
- the address belongs to a pairing an Android app started (
createBond, “bond routing”) → AppSupport;
- otherwise, “unexpected connection request; falling back to bonds”: the bridge looks up a list of addresses, and also queries
org.bluez (GetManagedObjects on /org/bluez/hci1), but the final target is the pair target, which is AppSupport when the setting is on.
So a device bonded only with BlueZ that reconnects on its own (headsets, car kits, speakers, keyboards) falls into case 3 and is sent to Android whenever the setting is on. In that case, being known to BlueZ does not seem to change the result.
There may be a related detail. The bridge rebuilds the address as a string with QString::number(byte, 16) plus toLower(), which gives 88:5:e7:20:6b:b7 (lowercase, no leading zero). It then compares that string case-sensitively with a QStringList. If that list holds addresses in the usual 88:05:E7:… form, the lookup can never match. I have not confirmed this.
7. What is and is not affected
- Pairing started on the phone (Sailfish Settings): fine. BlueZ starts it and the result is routed to BlueZ.
- Pairing started by an Android app (
createBond): handled by case 2, routed to AppSupport. Switching the setting off does not affect it.
- A device bonded with Sailfish that reconnects by itself: routed to Android when the setting is on. The device gets the wrong stack, fails authentication and, depending on its firmware, deletes its pairing. My headset does.
- With the setting off, only a device that asks on its own to pair with an Android app (rare) would now go to Sailfish.
Expected behaviour
An incoming connection from a device bonded with BlueZ should always go to BlueZ, whatever the pair-target setting. The pair target should only decide where connections from unknown devices go, which is what its description says: “incoming pairing requests”. The bridge should not need to copy pairings into Android. It only needs to route each address to the stack that holds its link key.
Suggested fix
- In the connection-request path, check BlueZ’s bonded devices (
Device1.Paired/Bonded, or /var/lib/bluetooth) before falling back to the pair target, and route bonded BlueZ devices to BlueZ.
- Possibly also: when Android answers a Link Key Request negatively for an address that BlueZ has bonded, the bridge could intercept it instead of letting it reach the remote device. That negative answer is what makes the headset delete its key.
- Check the address formatting/comparison above.
Workaround for users
Switch off Settings > Bluetooth > Send incoming pairing requests to AppSupport. Since then (11:13), the headset reconnects by itself and has kept its pairing. I will report back after a few days of normal use, including overnight power-offs.
Summary of the two issues in this topic
- (first post) After Bluetooth power-on the adapter is
Connectable=false, so bonded devices cannot call in at all. Worked around by forcing Connectable=true.
- (this post) When they can call in and the AppSupport pair target is on, the bridge may hand them to Android. Android fails authentication and the device deletes its pairing. Worked around by switching the pair target off.
AI disclosure: prepared interactively with Claude Code (Anthropic’s AI coding assistant). Every action was requested, reviewed and approved by me; nothing was decided or published autonomously. All logs above come from my own device and were checked by me.