Analyzed the latest log files and came to following conclusion about that is going on here:
The key point here is that the car initiates the pairing with the phone which then leads to a timing problem in ubuntu-system-settings. But step by step:
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/adapter.c:device_found_callback() hci0 addr 84:38:35:62:28:DF, rssi -91 flags 0x0000 eir_len 72
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:device_create() dst 84:38:35:62:28:DF
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:device_new() address 84:38:35:62:28:DF
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:device_new() Creating device /org/bluez/hci0/dev_84_38_35_62_28_DF
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:device_set_legacy() legacy 0
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:device_set_rssi_with_delta() rssi -91
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:btd_device_device_set_name() /org/bluez/hci0/dev_84_38_35_62_28_DF MacBook Air de Cristina
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.c:device_set_class() /org/bluez/hci0/dev_84_38_35_62_28_DF 0x38010C
Here we see that bluez correctly finds the device and directly continues with an pairing attempt which it gets from the remote device
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/adapter.c:pin_code_request_callback() hci0 00:0A:30:B3:52:4B
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.c:device_create() dst 00:0A:30:B3:52:4B
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.c:device_new() address 00:0A:30:B3:52:4B
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.c:device_new() Creating device /org/bluez/hci0/dev_00_0A_30_B3_52_4B
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.c:new_auth() Requesting agent authentication for 00:0A:30:B3:52:4B
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/agent.c:agent_ref() 0xb7113930: ref=2
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/agent.c:agent_ref() 0xb7113930: ref=3
So there is basically no time span between the phone detecting the device and getting the pairing request. BlueZ then sends out the pairing request to its registered agents:
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: Agent /com/canonical/SettingsBluetoothAgent/adapteragent replied with an error: org.bluez.Error.Rejected, The request was rejected: RequestPinCode
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/adapter.c:btd_adapter_pincode_reply() hci0 addr 00:0A:30:B3:52:4B pinlen 0
Analyzed the latest log files and came to following conclusion about that is going on here:
The key point here is that the car initiates the pairing with the phone which then leads to a timing problem in ubuntu- system- settings. But step by step:
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/adapter. c:device_ found_callback( ) hci0 addr 84:38:35:62:28:DF, rssi -91 flags 0x0000 eir_len 72 c:device_ create( ) dst 84:38:35:62:28:DF c:device_ new() address 84:38:35:62:28:DF c:device_ new() Creating device /org/bluez/ hci0/dev_ 84_38_35_ 62_28_DF c:device_ set_legacy( ) legacy 0 c:device_ set_rssi_ with_delta( ) rssi -91 c:btd_device_ device_ set_name( ) /org/bluez/ hci0/dev_ 84_38_35_ 62_28_DF MacBook Air de Cristina c:device_ set_class( ) /org/bluez/ hci0/dev_ 84_38_35_ 62_28_DF 0x38010C
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:45 ubuntu-phablet bluetoothd[880]: src/device.
Here we see that bluez correctly finds the device and directly continues with an pairing attempt which it gets from the remote device
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/adapter. c:pin_code_ request_ callback( ) hci0 00:0A:30:B3:52:4B c:device_ create( ) dst 00:0A:30:B3:52:4B c:device_ new() address 00:0A:30:B3:52:4B c:device_ new() Creating device /org/bluez/ hci0/dev_ 00_0A_30_ B3_52_4B c:new_auth( ) Requesting agent authentication for 00:0A:30:B3:52:4B c:agent_ ref() 0xb7113930: ref=2 c:agent_ ref() 0xb7113930: ref=3
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/device.
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/agent.
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/agent.
So there is basically no time span between the phone detecting the device and getting the pairing request. BlueZ then sends out the pairing request to its registered agents:
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: Agent /com/canonical/ SettingsBluetoo thAgent/ adapteragent replied with an error: org.bluez. Error.Rejected, The request was rejected: RequestPinCode c:btd_adapter_ pincode_ reply() hci0 addr 00:0A:30:B3:52:4B pinlen 0
Feb 23 09:43:46 ubuntu-phablet bluetoothd[880]: src/adapter.
.. which gets denied from settings app as it doesn't have the device in its internal list yet. See https:/ /bazaar. launchpad. net/~system- settings- touch/ubuntu- system- settings/ trunk/view/ head:/plugins/ bluetooth/ agent.cpp# L115 for details.
We need to rework ubuntu- system- settings here to add the new device based on the object path it gets from bluez with the pairing request.