Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4a20bc6 authored by Grzegorz Kolodziejczyk's avatar Grzegorz Kolodziejczyk Committed by Gerrit Code Review
Browse files

Merge "le_audio: Don't trigger connection when device is not disconnected"

parents 73b83f58 9914d0e7
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1063,8 +1063,17 @@ class LeAudioClientImpl : public LeAudioClient {
    LeAudioDevice* leAudioDevice = leAudioDevices_.FindByAddress(address);
    if (!leAudioDevice) {
      leAudioDevices_.Add(address, DeviceConnectState::CONNECTING_BY_USER);

    } else {
      if (leAudioDevice->GetConnectionState() !=
          DeviceConnectState::DISCONNECTED) {
        LOG_ERROR(
            "Device %s is in invalid state: %s",
            leAudioDevice->address_.ToString().c_str(),
            bluetooth::common::ToString(leAudioDevice->GetConnectionState())
                .c_str());

        return;
      }
      leAudioDevice->SetConnectionState(DeviceConnectState::CONNECTING_BY_USER);

      le_audio::MetricsCollector::Get()->OnConnectionStateChanged(