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

Commit 04e07d6e authored by Yuyang Huang's avatar Yuyang Huang Committed by Automerger Merge Worker
Browse files

Merge "Open SCO based on HFP ProviderInfo" into main am: 15298d7a am: cf6891e4

parents 4df53087 cf6891e4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "btm_api_types.h"
#include "hardware/bluetooth.h"
#include "hardware/bluetooth_headset_interface.h"
#include "provider_info.h"
#include "types/raw_address.h"

namespace bluetooth {
@@ -61,6 +62,13 @@ tBTA_AG_SCB* get_hfp_active_device_callback() {
  return cb;
}

std::unordered_map<int, ::hfp::sco_config> HfpTransport::GetHfpScoConfig(
    SessionType sessionType) {
  auto providerInfo =
      ::bluetooth::audio::aidl::ProviderInfo::GetProviderInfo(sessionType);
  return providerInfo->GetHfpScoConfig();
}

HfpTransport::HfpTransport() { hfp_pending_cmd_ = HFP_CTRL_CMD_NONE; }

BluetoothAudioCtrlAck HfpTransport::StartRequest() {
+5 −0
Original line number Diff line number Diff line
@@ -17,7 +17,9 @@
#pragma once

#include <cstdint>
#include <unordered_map>

#include "bta/ag/bta_ag_int.h"
#include "client_interface_aidl.h"

namespace bluetooth {
@@ -68,6 +70,9 @@ class HfpTransport {

  void LogBytesProcessed(size_t bytes_read);

  static std::unordered_map<int, ::hfp::sco_config> GetHfpScoConfig(
      SessionType sessionType);

 private:
  tHFP_CTRL_CMD hfp_pending_cmd_;
};
+6 −0
Original line number Diff line number Diff line
@@ -506,6 +506,12 @@ void HfpClientInterface::Offload::CancelStreamingRequest() {
  }
}

std::unordered_map<int, ::hfp::sco_config>
HfpClientInterface::Offload::GetHfpScoConfig() {
  return aidl::hfp::HfpTransport::GetHfpScoConfig(
      aidl::SessionType::HFP_HARDWARE_OFFLOAD_DATAPATH);
}

HfpClientInterface::Offload* HfpClientInterface::GetOffload(
    bluetooth::common::MessageLoopThread* /*message_loop*/) {
  if (!is_aidl_support_hfp()) {
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ class HfpClientInterface {
    void UpdateAudioConfigToHal(const ::hfp::offload_config& config) override;
    void ConfirmStreamingRequest() override;
    void CancelStreamingRequest() override;
    std::unordered_map<int, ::hfp::sco_config> GetHfpScoConfig();
  };

  // Get HFP software decoding client interface if it's not previously acquired
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ bool HfpClientInterface::ReleaseOffload(HfpClientInterface::Offload* offload) {

HfpClientInterface* HfpClientInterface::Get() { return nullptr; }

std::unordered_map<int, ::hfp::sco_config>
HfpClientInterface::Offload::GetHfpScoConfig() {
  return std::unordered_map<int, ::hfp::sco_config>();
}

}  // namespace hfp
}  // namespace audio
}  // namespace bluetooth
Loading