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

Commit dddf3857 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Automerger Merge Worker
Browse files

Merge changes Ie3a96cd8,I67f3a66e am: 58b3822b am: 1f3df22f am: 8cc61462...

Merge changes Ie3a96cd8,I67f3a66e am: 58b3822b am: 1f3df22f am: 8cc61462 am: 30002ca8 am: 9683ceff

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2236922



Change-Id: I260a9217dffab379f796b0428c66608a4a424c3d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6709b6ac 9683ceff
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1076,7 +1076,7 @@ public class LeAudioService extends ProfileService {
            }

            if (DBG) {
                Log.d(TAG, "connect(): " + device);
                Log.d(TAG, "connect(): " + storedDevice);
            }

            synchronized (mStateMachines) {
@@ -1248,8 +1248,13 @@ public class LeAudioService extends ProfileService {
                                break;
                            case LeAudioStackEvent.CONNECTION_STATE_CONNECTED:
                            case LeAudioStackEvent.CONNECTION_STATE_CONNECTING:
                                if (descriptor != null) {
                                    if (DBG) Log.d(TAG, "Removing from lost devices : " + device);
                                if (descriptor != null
                                        && Objects.equals(
                                                descriptor.mLostLeadDeviceWhileStreaming,
                                                device)) {
                                    if (DBG) {
                                        Log.d(TAG, "Removing from lost devices : " + device);
                                    }
                                    descriptor.mLostLeadDeviceWhileStreaming = null;
                                    /* Try to connect other devices from the group */
                                    connectSet(device);
+2 −3
Original line number Diff line number Diff line
@@ -2432,14 +2432,13 @@ bool LeAudioDevice::ActivateConfiguredAses(LeAudioContextType context_type) {
}

void LeAudioDevice::DeactivateAllAses(void) {
  /* Just clear states and keep previous configuration for use
   * in case device will get reconnected
   */
  for (auto& ase : ases_) {
    if (ase.active) {
      ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
      ase.data_path_state = AudioStreamDataPathState::IDLE;
      ase.active = false;
      ase.cis_id = le_audio::kInvalidCisId;
      ase.cis_conn_hdl = 0;
    }
  }
}
+19 −1
Original line number Diff line number Diff line
@@ -651,6 +651,8 @@ class LeAudioAseConfigurationTest : public Test {
  void TestAsesInactivated(const LeAudioDevice* device) {
    for (const auto& ase : device->ases_) {
      ASSERT_FALSE(ase.active);
      ASSERT_TRUE(ase.cis_id == ::le_audio::kInvalidCisId);
      ASSERT_TRUE(ase.cis_conn_hdl == 0);
    }
  }

@@ -948,10 +950,20 @@ TEST_F(LeAudioAseConfigurationTest, test_reconnection_media) {

  TestSingleAseConfiguration(LeAudioContextType::MEDIA, data, 2, configuration);

  SetCisInformationToActiveAse();
  /* Generate CISes, symulate CIG creation and assign cis handles to ASEs.*/
  group_->CigGenerateCisIds(LeAudioContextType::MEDIA);
  std::vector<uint16_t> handles = {0x0012, 0x0013};
  group_->CigAssignCisConnHandles(handles);
  group_->CigAssignCisIds(left);
  group_->CigAssignCisIds(right);

  TestActiveAses();
  /* Left got disconnected */
  left->DeactivateAllAses();

  /* Unassign from the group*/
  group_->CigUnassignCis(left);

  TestAsesInactivated(left);

  /* Prepare reconfiguration */
@@ -979,6 +991,12 @@ TEST_F(LeAudioAseConfigurationTest, test_reconnection_media) {
    TestGroupAseConfigurationVerdict(data[i]);
  }

  /* Before device is rejoining, and group already exist, cis handles are
   * assigned before sending codec config
   */
  group_->CigAssignCisIds(left);
  group_->CigAssignCisConnHandlesToAses(left);

  TestActiveAses();
}
}  // namespace