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

Commit a85af3eb authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk
Browse files

le_audio: Use bi-directional scenario for ringtone for ringtone

Patch adds bi-directional scenario for ringtone to avoid
re-configuration while progressing to conversational - answer call.

Bug: 233961821
Tag: #feature
Sponsor: jpawlowski@
Test: atest bluetooth_le_audio_test
Test: atest bluetooth_le_audio_client_test
Change-Id: Ic450fa8e6ef1c1c26e1e507f636b45505f6b249e
parent 82b06cbe
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -8,6 +8,20 @@
        {
            "name": "Ringtone",
            "configurations": [
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_32_2_Server_Preferred",
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_32_2_1",
                "DualDev_OneChanStereoSnk_OneChanMonoSrc_32_2_Server_Preferred",
                "DualDev_OneChanStereoSnk_OneChanMonoSrc_32_2_1",
                "DualDev_OneChanDoubleStereoSnk_OneChanMonoSrc_32_2_Server_Preferred",
                "DualDev_OneChanDoubleStereoSnk_OneChanMonoSrc_32_2_1",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_32_2_Server_Preferred",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_32_2_1",
                "SingleDev_TwoChanStereoSnk_OneChanMonoSrc_32_2_Server_Preferred",
                "SingleDev_TwoChanStereoSnk_OneChanMonoSrc_32_2_1",
                "SingleDev_OneChanStereoSnk_OneChanMonoSrc_32_2_Server_Preferred",
                "SingleDev_OneChanStereoSnk_OneChanMonoSrc_32_2_1",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_32_2_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_32_2_1",
                "DualDev_OneChanStereoSnk_16_2_Server_Preferred",
                "DualDev_OneChanStereoSnk_16_2_1",
                "DualDev_OneChanStereoSnk_16_1_Server_Preferred",
+11 −10
Original line number Diff line number Diff line
@@ -199,7 +199,8 @@ bool IsLc3SettingSupported(LeAudioContextType context_type, Lc3SettingId id) {
  /* Update those values, on any change of codec linked with content type */
  switch (context_type) {
    case LeAudioContextType::RINGTONE:
      if (id == Lc3SettingId::LC3_16_1 || id == Lc3SettingId::LC3_16_2)
      if (id == Lc3SettingId::LC3_16_2 || id == Lc3SettingId::LC3_16_1 ||
          id == Lc3SettingId::LC3_32_2)
        return true;

      break;
@@ -686,10 +687,10 @@ class LeAudioAseConfigurationTest : public Test {
};

TEST_F(LeAudioAseConfigurationTest, test_mono_speaker_ringtone) {
  LeAudioDevice* mono_speaker = AddTestDevice(1, 0);
  TestGroupAseConfigurationData data({mono_speaker,
                                      kLeAudioCodecLC3ChannelCountSingleChannel,
                                      kLeAudioCodecLC3ChannelCountNone, 1, 0});
  LeAudioDevice* mono_speaker = AddTestDevice(1, 1);
  TestGroupAseConfigurationData data(
      {mono_speaker, kLeAudioCodecLC3ChannelCountSingleChannel,
       kLeAudioCodecLC3ChannelCountSingleChannel, 1, 0});

  TestGroupAseConfiguration(LeAudioContextType::RINGTONE, &data, 1);
}
@@ -713,10 +714,10 @@ TEST_F(LeAudioAseConfigurationTest, test_mono_speaker_media) {
}

TEST_F(LeAudioAseConfigurationTest, test_bounded_headphones_ringtone) {
  LeAudioDevice* bounded_headphones = AddTestDevice(2, 0);
  TestGroupAseConfigurationData data({bounded_headphones,
                                      kLeAudioCodecLC3ChannelCountTwoChannel,
                                      kLeAudioCodecLC3ChannelCountNone, 2, 0});
  LeAudioDevice* bounded_headphones = AddTestDevice(2, 1);
  TestGroupAseConfigurationData data(
      {bounded_headphones, kLeAudioCodecLC3ChannelCountTwoChannel,
       kLeAudioCodecLC3ChannelCountSingleChannel, 2, 0});

  TestGroupAseConfiguration(LeAudioContextType::RINGTONE, &data, 1);
}
@@ -849,7 +850,7 @@ TEST_F(LeAudioAseConfigurationTest, test_handsfree_media) {
}

TEST_F(LeAudioAseConfigurationTest, test_lc3_config_ringtone) {
  AddTestDevice(1, 0);
  AddTestDevice(1, 1);

  TestLc3CodecConfig(LeAudioContextType::RINGTONE);
}