@@ -7486,7 +7486,7 @@ static void adapter_remove_connection(struct btd_adapter *adapter,
device_cancel_authentication(device, TRUE);
/* If another bearer is still connected */
- if (btd_device_is_connected(device))
+ if (btd_device_bearer_is_connected(device))
return;
adapter->connections = g_slist_remove(adapter->connections, device);
@@ -3273,13 +3273,18 @@ uint8_t btd_device_get_bdaddr_type(struct btd_device *dev)
bool btd_device_is_connected(struct btd_device *dev)
{
- if (dev->bredr_state.connected || dev->le_state.connected)
+ if (btd_device_bearer_is_connected(dev))
return true;
return find_service_with_state(dev->services,
BTD_SERVICE_STATE_CONNECTED);
}
+bool btd_device_bearer_is_connected(struct btd_device *dev)
+{
+ return dev->bredr_state.connected || dev->le_state.connected;
+}
+
static void clear_temporary_timer(struct btd_device *dev)
{
if (dev->temporary_timer) {
@@ -104,6 +104,7 @@ void device_set_rssi(struct btd_device *device, int8_t rssi);
void device_set_tx_power(struct btd_device *device, int8_t tx_power);
void device_set_flags(struct btd_device *device, uint8_t flags);
bool btd_device_is_connected(struct btd_device *dev);
+bool btd_device_bearer_is_connected(struct btd_device *dev);
uint8_t btd_device_get_bdaddr_type(struct btd_device *dev);
bool device_is_retrying(struct btd_device *device);
void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,