Loading system/bta/vc/devices.h +4 −2 Original line number Diff line number Diff line Loading @@ -99,10 +99,12 @@ public: stream << " volume: " << +volume << "\n" << " mute: " << +mute << "\n" << " change_counter: " << +change_counter << "\n" << " flags: " << +flags << "\n" << " device read: " << device_ready << "\n" << " device ready: " << device_ready << "\n" << " connecting_actively: " << connecting_actively << "\n" << " change_counter: " << +change_counter << "\n"; << " is encrypted: " << IsEncryptionEnabled() << "\n" << " GATT operations pending: " << handles_pending.size() << "\n"; dprintf(fd, "%s", stream.str().c_str()); audio_offsets.Dump(fd); Loading system/bta/vc/vc.cc +4 −6 Original line number Diff line number Diff line Loading @@ -195,7 +195,7 @@ public: /* Make sure to remove device from background connect. * It will be added back if needed, when device got disconnected */ BTA_GATTC_CancelOpen(gatt_if_, address, false); BTA_GATTC_CancelOpen(gatt_if_, address, true); if (device->IsEncryptionEnabled()) { OnEncryptionComplete(address, tBTM_STATUS::BTM_SUCCESS); Loading Loading @@ -810,14 +810,14 @@ public: bluetooth::log::info("{}", address); /* Removes all registrations for connection. */ BTA_GATTC_CancelOpen(gatt_if_, address, false); BTA_GATTC_CancelOpen(gatt_if_, address, true); Disconnect(address); volume_control_devices_.Remove(address); } void OnGattDisconnected(tCONN_ID connection_id, tGATT_IF /*client_if*/, RawAddress remote_bda, tGATT_DISCONN_REASON reason) { tGATT_DISCONN_REASON /*reason*/) { VolumeControlDevice* device = volume_control_devices_.FindByConnId(connection_id); if (!device) { bluetooth::log::error("Skipping unknown device disconnect, connection_id={:#x}", Loading @@ -838,10 +838,8 @@ public: bool notify = device->IsReady() || device->connecting_actively; device_cleanup_helper(device, notify); if (reason != GATT_CONN_TERMINATE_LOCAL_HOST && device->connecting_actively) { StartOpportunisticConnect(remote_bda); } } void RemoveDeviceFromOperationList(const RawAddress& addr) { if (ongoing_operations_.empty()) { Loading system/bta/vc/vc_test.cc +3 −2 Original line number Diff line number Diff line Loading @@ -572,7 +572,7 @@ protected: } void TestRemove(const RawAddress& address, uint16_t conn_id) { EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, false)); EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, true)); if (conn_id) { EXPECT_CALL(gatt_interface, Close(conn_id)); } else { Loading Loading @@ -899,7 +899,7 @@ TEST_F(VolumeControlTest, test_reconnect_after_timeout) { // Disconnect not connected device - upper layer times out and needs a // disconnection event to leave the transient Connecting state EXPECT_CALL(callbacks, OnConnectionState(ConnectionState::DISCONNECTED, address)); EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, false)).Times(0); EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, _)).Times(0); TestDisconnect(address, 0); // Above the device was not connected and we got Disconnect request from the Loading Loading @@ -984,6 +984,7 @@ TEST_F(VolumeControlTest, test_disconnected_while_autoconnect) { TestAppRegister(); TestAddFromStorage(test_address); GetConnectedEvent(test_address, 1); Mock::VerifyAndClearExpectations(&gatt_interface); // autoconnect - don't indicate disconnection EXPECT_CALL(callbacks, OnConnectionState(ConnectionState::DISCONNECTED, test_address)).Times(0); GetDisconnectedEvent(test_address, 1); Loading Loading
system/bta/vc/devices.h +4 −2 Original line number Diff line number Diff line Loading @@ -99,10 +99,12 @@ public: stream << " volume: " << +volume << "\n" << " mute: " << +mute << "\n" << " change_counter: " << +change_counter << "\n" << " flags: " << +flags << "\n" << " device read: " << device_ready << "\n" << " device ready: " << device_ready << "\n" << " connecting_actively: " << connecting_actively << "\n" << " change_counter: " << +change_counter << "\n"; << " is encrypted: " << IsEncryptionEnabled() << "\n" << " GATT operations pending: " << handles_pending.size() << "\n"; dprintf(fd, "%s", stream.str().c_str()); audio_offsets.Dump(fd); Loading
system/bta/vc/vc.cc +4 −6 Original line number Diff line number Diff line Loading @@ -195,7 +195,7 @@ public: /* Make sure to remove device from background connect. * It will be added back if needed, when device got disconnected */ BTA_GATTC_CancelOpen(gatt_if_, address, false); BTA_GATTC_CancelOpen(gatt_if_, address, true); if (device->IsEncryptionEnabled()) { OnEncryptionComplete(address, tBTM_STATUS::BTM_SUCCESS); Loading Loading @@ -810,14 +810,14 @@ public: bluetooth::log::info("{}", address); /* Removes all registrations for connection. */ BTA_GATTC_CancelOpen(gatt_if_, address, false); BTA_GATTC_CancelOpen(gatt_if_, address, true); Disconnect(address); volume_control_devices_.Remove(address); } void OnGattDisconnected(tCONN_ID connection_id, tGATT_IF /*client_if*/, RawAddress remote_bda, tGATT_DISCONN_REASON reason) { tGATT_DISCONN_REASON /*reason*/) { VolumeControlDevice* device = volume_control_devices_.FindByConnId(connection_id); if (!device) { bluetooth::log::error("Skipping unknown device disconnect, connection_id={:#x}", Loading @@ -838,10 +838,8 @@ public: bool notify = device->IsReady() || device->connecting_actively; device_cleanup_helper(device, notify); if (reason != GATT_CONN_TERMINATE_LOCAL_HOST && device->connecting_actively) { StartOpportunisticConnect(remote_bda); } } void RemoveDeviceFromOperationList(const RawAddress& addr) { if (ongoing_operations_.empty()) { Loading
system/bta/vc/vc_test.cc +3 −2 Original line number Diff line number Diff line Loading @@ -572,7 +572,7 @@ protected: } void TestRemove(const RawAddress& address, uint16_t conn_id) { EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, false)); EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, true)); if (conn_id) { EXPECT_CALL(gatt_interface, Close(conn_id)); } else { Loading Loading @@ -899,7 +899,7 @@ TEST_F(VolumeControlTest, test_reconnect_after_timeout) { // Disconnect not connected device - upper layer times out and needs a // disconnection event to leave the transient Connecting state EXPECT_CALL(callbacks, OnConnectionState(ConnectionState::DISCONNECTED, address)); EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, false)).Times(0); EXPECT_CALL(gatt_interface, CancelOpen(gatt_if, address, _)).Times(0); TestDisconnect(address, 0); // Above the device was not connected and we got Disconnect request from the Loading Loading @@ -984,6 +984,7 @@ TEST_F(VolumeControlTest, test_disconnected_while_autoconnect) { TestAppRegister(); TestAddFromStorage(test_address); GetConnectedEvent(test_address, 1); Mock::VerifyAndClearExpectations(&gatt_interface); // autoconnect - don't indicate disconnection EXPECT_CALL(callbacks, OnConnectionState(ConnectionState::DISCONNECTED, test_address)).Times(0); GetDisconnectedEvent(test_address, 1); Loading