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

Commit 74876ad2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes Ia0b94726,I83468115,I8226c327,I0a439d16 into tm-dev am: 4120077e

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



Change-Id: I50b14cacbe5745ea54acb9413ce6e6f7da2763df
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 785630cc 4120077e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ table QosConfiguration {
table AudioSetConfiguration {
table AudioSetConfiguration {
    name: string (key, required);
    name: string (key, required);
    codec_config_name: string (required);
    codec_config_name: string (required);
    qos_config_name: string (required);
    qos_config_name: [string] (required);
}
}
table AudioSetConfigurations {
table AudioSetConfigurations {
    _comments_: [string];
    _comments_: [string];
+777 −90

File changed.

Preview size limit exceeded, changes collapsed.

+26 −2
Original line number Original line Diff line number Diff line
@@ -48,7 +48,9 @@
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_2_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_2_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_2_1",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_2_1",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_1"
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_1",
                "VND_SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_32khz_Server_Prefered_1",
                "VND_SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_32khz_60oct_R3_L22_1"
            ]
            ]
        },
        },
        {
        {
@@ -77,7 +79,29 @@
                "SingleDev_OneChanMonoSnk_16_2_Server_Preferred",
                "SingleDev_OneChanMonoSnk_16_2_Server_Preferred",
                "SingleDev_OneChanMonoSnk_16_2_2",
                "SingleDev_OneChanMonoSnk_16_2_2",
                "SingleDev_OneChanMonoSnk_16_1_Server_Preferred",
                "SingleDev_OneChanMonoSnk_16_1_Server_Preferred",
                "SingleDev_OneChanMonoSnk_16_1_2"
                "SingleDev_OneChanMonoSnk_16_1_2",
                "VND_DualDev_OneChanStereoSnk_48khz_100octs_Server_Preferred_1",
                "VND_DualDev_OneChanStereoSnk_48khz_100octs_R15_L70_1",
                "VND_SingleDev_TwoChanStereoSnk_48khz_100octs_Server_Preferred_1",
                "VND_SingleDev_TwoChanStereoSnk_48khz_100octs_R15_L70_1",
                "VND_SingleDev_OneChanStereoSnk_48khz_100octs_Server_Preferred_1",
                "VND_SingleDev_OneChanStereoSnk_48khz_100octs_R15_L70_1"
            ]
        },
        {
            "name": "Game",
            "configurations": [
                "VND_SingleDev_TwoChanStereoSnk_48khz_75octs_TwoChanStereoSrc_16khz_30octs_Server_Preferred_1",
                "VND_SingleDev_TwoChanStereoSnk_48khz_75octs_R5_L12_TwoChanStereoSrc_16khz_30octs_R3_L12_1",
                "VND_SingleDev_TwoChanStereoSnk_48khz_75octs_Server_Preferred_1",
                "VND_SingleDev_TwoChanStereoSnk_48khz_75octs_R5_L12_1"
            ]
        },
        {
            "name": "Recording",
            "configurations": [
                "VND_SingleDev_TwoChanStereoSrc_48khz_100octs_Server_Preferred_1",
                "VND_SingleDev_TwoChanStereoSrc_48khz_100octs_R11_L40_1"
            ]
            ]
        },
        },
        {
        {
+11 −1
Original line number Original line Diff line number Diff line
@@ -188,6 +188,7 @@ enum class Lc3SettingId {
  LC3_48_4,
  LC3_48_4,
  LC3_48_5,
  LC3_48_5,
  LC3_48_6,
  LC3_48_6,
  LC3_VND_1,
  _END,
  _END,
  UNSUPPORTED = _END,
  UNSUPPORTED = _END,
};
};
@@ -206,7 +207,8 @@ bool IsLc3SettingSupported(LeAudioContextType context_type, Lc3SettingId id) {


    case LeAudioContextType::MEDIA:
    case LeAudioContextType::MEDIA:
      if (id == Lc3SettingId::LC3_16_1 || id == Lc3SettingId::LC3_16_2 ||
      if (id == Lc3SettingId::LC3_16_1 || id == Lc3SettingId::LC3_16_2 ||
          id == Lc3SettingId::LC3_48_4)
          id == Lc3SettingId::LC3_48_4 || id == Lc3SettingId::LC3_48_2 ||
          id == Lc3SettingId::LC3_VND_1)
        return true;
        return true;


      break;
      break;
@@ -244,6 +246,7 @@ uint8_t GetSamplingFrequency(Lc3SettingId id) {
    case Lc3SettingId::LC3_48_4:
    case Lc3SettingId::LC3_48_4:
    case Lc3SettingId::LC3_48_5:
    case Lc3SettingId::LC3_48_5:
    case Lc3SettingId::LC3_48_6:
    case Lc3SettingId::LC3_48_6:
    case Lc3SettingId::LC3_VND_1:
      return ::le_audio::codec_spec_conf::kLeAudioSamplingFreq48000Hz;
      return ::le_audio::codec_spec_conf::kLeAudioSamplingFreq48000Hz;
    case Lc3SettingId::UNSUPPORTED:
    case Lc3SettingId::UNSUPPORTED:
      return kLeAudioSamplingFreqRfu;
      return kLeAudioSamplingFreqRfu;
@@ -270,6 +273,7 @@ uint8_t GetFrameDuration(Lc3SettingId id) {
    case Lc3SettingId::LC3_48_2:
    case Lc3SettingId::LC3_48_2:
    case Lc3SettingId::LC3_48_4:
    case Lc3SettingId::LC3_48_4:
    case Lc3SettingId::LC3_48_6:
    case Lc3SettingId::LC3_48_6:
    case Lc3SettingId::LC3_VND_1:
      return ::le_audio::codec_spec_conf::kLeAudioCodecLC3FrameDur10000us;
      return ::le_audio::codec_spec_conf::kLeAudioCodecLC3FrameDur10000us;
    case Lc3SettingId::UNSUPPORTED:
    case Lc3SettingId::UNSUPPORTED:
      return kLeAudioCodecLC3FrameDurRfu;
      return kLeAudioCodecLC3FrameDurRfu;
@@ -300,6 +304,7 @@ uint16_t GetOctetsPerCodecFrame(Lc3SettingId id) {
    case Lc3SettingId::LC3_48_1:
    case Lc3SettingId::LC3_48_1:
      return 75;
      return 75;
    case Lc3SettingId::LC3_48_2:
    case Lc3SettingId::LC3_48_2:
    case Lc3SettingId::LC3_VND_1:
      return 100;
      return 100;
    case Lc3SettingId::LC3_48_3:
    case Lc3SettingId::LC3_48_3:
      return 90;
      return 90;
@@ -519,6 +524,11 @@ class LeAudioAseConfigurationTest : public Test {
                             data[i].active_channel_num_src) > 0;
                             data[i].active_channel_num_src) > 0;


        /* Prepare PAC's */
        /* Prepare PAC's */
        /* Note this test requires that reach TwoStereoChan configuration
         * version has similar version for OneStereoChan (both SingleDev,
         * DualDev). This is just how the test is created and this limitation
         * should be removed b/230107540
         */
        PublishedAudioCapabilitiesBuilder snk_pac_builder, src_pac_builder;
        PublishedAudioCapabilitiesBuilder snk_pac_builder, src_pac_builder;
        for (const auto& entry : (*audio_set_conf).confs) {
        for (const auto& entry : (*audio_set_conf).confs) {
          if (entry.direction == kLeAudioDirectionSink) {
          if (entry.direction == kLeAudioDirectionSink) {
+60 −12
Original line number Original line Diff line number Diff line
@@ -238,24 +238,62 @@ struct AudioSetConfigurationProviderJson {
      std::vector<const bluetooth::le_audio::CodecConfiguration*>* codec_cfgs,
      std::vector<const bluetooth::le_audio::CodecConfiguration*>* codec_cfgs,
      std::vector<const bluetooth::le_audio::QosConfiguration*>* qos_cfgs) {
      std::vector<const bluetooth::le_audio::QosConfiguration*>* qos_cfgs) {
    std::vector<SetConfiguration> subconfigs;
    std::vector<SetConfiguration> subconfigs;
    QosConfigSetting qos;
    QosConfigSetting qos_sink;
    QosConfigSetting qos_source;
    const bluetooth::le_audio::CodecConfiguration* codec_cfg = NULL;
    const bluetooth::le_audio::CodecConfiguration* codec_cfg = NULL;
    const bluetooth::le_audio::QosConfiguration* qos_cfg = NULL;
    const bluetooth::le_audio::QosConfiguration* qos_sink_cfg = NULL;
    const bluetooth::le_audio::QosConfiguration* qos_source_cfg = NULL;


    const char* codec_config_key = flat_cfg->codec_config_name()->c_str();
    const char* codec_config_key = flat_cfg->codec_config_name()->c_str();
    const char* qos_config_key = flat_cfg->qos_config_name()->c_str();
    auto* qos_config_key_array = flat_cfg->qos_config_name();

    char default_qos[] = "QoS_Config_Server_Preferred";

    const char* qos_sink_key = default_qos;
    const char* qos_source_key = default_qos;

    /* We expect maximum two QoS settings. First for Sink and second for Source
     */
    if (qos_config_key_array->size() > 0) {
      qos_sink_key = qos_config_key_array->Get(0)->c_str();
      if (qos_config_key_array->size() > 1) {
        qos_source_key = qos_config_key_array->Get(1)->c_str();
      } else {
        qos_source_key = qos_sink_key;
      }
    }

    LOG_DEBUG("Config name %s, qos_sink %s, qos_source %s", codec_config_key,
              qos_sink_key, qos_source_key);


    for (auto i = qos_cfgs->begin(); i != qos_cfgs->end(); ++i) {
    for (auto i = qos_cfgs->begin(); i != qos_cfgs->end(); ++i) {
      if (0 == strcmp((*i)->name()->c_str(), qos_config_key)) {
      if (0 == strcmp((*i)->name()->c_str(), qos_sink_key)) {
        qos_cfg = *i;
        qos_sink_cfg = *i;
        break;
        break;
      }
      }
    }
    }
    if (qos_cfg != NULL) {

      qos.retransmission_number = qos_cfg->retransmission_number();
    for (auto i = qos_cfgs->begin(); i != qos_cfgs->end(); ++i) {
      qos.max_transport_latency = qos_cfg->max_transport_latency();
      if (0 == strcmp((*i)->name()->c_str(), qos_source_key)) {
        qos_source_cfg = *i;
        break;
      }
    }

    if (qos_sink_cfg != NULL) {
      qos_sink.retransmission_number = qos_sink_cfg->retransmission_number();
      qos_sink.max_transport_latency = qos_sink_cfg->max_transport_latency();
    } else {
    } else {
      LOG_ERROR("No qos config matching key %s found", qos_config_key);
      LOG_ERROR("No qos config matching key %s found", qos_sink_key);
    }

    if (qos_source_cfg != NULL) {
      qos_source.retransmission_number =
          qos_source_cfg->retransmission_number();
      qos_source.max_transport_latency =
          qos_source_cfg->max_transport_latency();
    } else {
      LOG_ERROR("No qos config matching key %s found", qos_source_key);
    }
    }


    for (auto i = codec_cfgs->begin(); i != codec_cfgs->end(); ++i) {
    for (auto i = codec_cfgs->begin(); i != codec_cfgs->end(); ++i) {
@@ -267,7 +305,13 @@ struct AudioSetConfigurationProviderJson {
    if (codec_cfg != NULL && codec_cfg->subconfigurations()) {
    if (codec_cfg != NULL && codec_cfg->subconfigurations()) {
      /* Load subconfigurations */
      /* Load subconfigurations */
      for (auto subconfig : *codec_cfg->subconfigurations()) {
      for (auto subconfig : *codec_cfg->subconfigurations()) {
        subconfigs.push_back(SetConfigurationFromFlatSubconfig(subconfig, qos));
        if (subconfig->direction() == le_audio::types::kLeAudioDirectionSink) {
          subconfigs.push_back(
              SetConfigurationFromFlatSubconfig(subconfig, qos_sink));
        } else {
          subconfigs.push_back(
              SetConfigurationFromFlatSubconfig(subconfig, qos_source));
        }
      }
      }
    } else {
    } else {
      if (codec_cfg == NULL) {
      if (codec_cfg == NULL) {
@@ -437,6 +481,8 @@ struct AudioSetConfigurationProviderJson {
            {"Media", types::LeAudioContextType::MEDIA},
            {"Media", types::LeAudioContextType::MEDIA},
            {"Conversational", types::LeAudioContextType::CONVERSATIONAL},
            {"Conversational", types::LeAudioContextType::CONVERSATIONAL},
            {"Ringtone", types::LeAudioContextType::RINGTONE},
            {"Ringtone", types::LeAudioContextType::RINGTONE},
            {"Recording", types::LeAudioContextType::LIVE},
            {"Game", types::LeAudioContextType::GAME},
            {"Default", types::LeAudioContextType::UNSPECIFIED},
            {"Default", types::LeAudioContextType::UNSPECIFIED},
        };
        };
    return scenarios.count(scenario) ? scenarios.at(scenario)
    return scenarios.count(scenario) ? scenarios.at(scenario)
@@ -466,7 +512,7 @@ struct AudioSetConfigurationProvider::impl {


    for (LeAudioContextType context : types::kLeAudioContextAllTypesArray) {
    for (LeAudioContextType context : types::kLeAudioContextAllTypesArray) {
      auto confs = Get()->GetConfigurations(context);
      auto confs = Get()->GetConfigurations(context);
      stream << "  === Configurations for context type: " << (int)context
      stream << "\n  === Configurations for context type: " << (int)context
             << ", num: " << (confs == nullptr ? 0 : confs->size()) << " \n";
             << ", num: " << (confs == nullptr ? 0 : confs->size()) << " \n";
      if (confs->size() > 0) {
      if (confs->size() > 0) {
        for (const auto& conf : *confs) {
        for (const auto& conf : *confs) {
@@ -483,7 +529,9 @@ struct AudioSetConfigurationProvider::impl {
                   << "     qos->retransmission_number: "
                   << "     qos->retransmission_number: "
                   << +ent.qos.retransmission_number << " \n"
                   << +ent.qos.retransmission_number << " \n"
                   << "     qos->max_transport_latency: "
                   << "     qos->max_transport_latency: "
                   << +ent.qos.max_transport_latency << " \n";
                   << +ent.qos.max_transport_latency << " \n"
                   << "     channel count: "
                   << +ent.codec.GetConfigChannelCount() << "\n";
          }
          }
        }
        }
      }
      }
Loading