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

Commit 6e0be93a authored by Henri Chataing's avatar Henri Chataing
Browse files

audio_hal_interface: Split off A2DP AIDL bindings

Move everything A2DP specific to system/audio_hal_interface/aidl/a2dp
Common definitions for the client interface and transport are duplicated
under the namespace bluetooth::audio::aidl::a2dp.

The common definitions will be tailored down to A2DP's usecase in a
follow up change.

Bug: 365022887
Test: m com.android.btservices
Test: Manual streaming test
Flag: EXEMPT, mechanical refactor
Change-Id: I32e5b447487fdde25845a62349db843262fa54d4
parent 54233ccc
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -42,11 +42,13 @@ cc_library_static {
            ],
            srcs: [
                "a2dp_encoding.cc",
                "aidl/a2dp_encoding_aidl.cc",
                "aidl/a2dp_provider_info.cc",
                "aidl/a2dp/a2dp_encoding_aidl.cc",
                "aidl/a2dp/a2dp_provider_info.cc",
                "aidl/a2dp/bluetooth_audio_port_impl.cc",
                "aidl/a2dp/client_interface_aidl.cc",
                "aidl/a2dp/codec_status_aidl.cc",
                "aidl/bluetooth_audio_port_impl.cc",
                "aidl/client_interface_aidl.cc",
                "aidl/codec_status_aidl.cc",
                "aidl/hearing_aid_software_encoding_aidl.cc",
                "aidl/hfp_client_interface_aidl.cc",
                "aidl/le_audio_software_aidl.cc",
@@ -164,8 +166,8 @@ cc_test {
    srcs: [
        ":TestCommonMockFunctions",
        ":TestMockAudioHalInterface",
        "aidl/a2dp_provider_info.cc",
        "aidl/a2dp_provider_info_unittest.cc",
        "aidl/a2dp/a2dp_provider_info.cc",
        "aidl/a2dp/a2dp_provider_info_unittest.cc",
    ],
    shared_libs: [
        "libaconfig_storage_read_api_cc",
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@

#include <vector>

#include "aidl/a2dp_encoding_aidl.h"
#include "aidl/a2dp/a2dp_encoding_aidl.h"
#include "hal_version_manager.h"
#include "hidl/a2dp_encoding_hidl.h"

+12 −12
Original line number Diff line number Diff line
@@ -57,16 +57,16 @@ using ::aidl::android::hardware::bluetooth::audio::CodecConfiguration;
using ::aidl::android::hardware::bluetooth::audio::PcmConfiguration;
using ::aidl::android::hardware::bluetooth::audio::SessionType;

using ::bluetooth::audio::aidl::BluetoothAudioCtrlAck;
using ::bluetooth::audio::aidl::BluetoothAudioSinkClientInterface;
using ::bluetooth::audio::aidl::codec::A2dpAacToHalConfig;
using ::bluetooth::audio::aidl::codec::A2dpAptxToHalConfig;
using ::bluetooth::audio::aidl::codec::A2dpCodecToHalBitsPerSample;
using ::bluetooth::audio::aidl::codec::A2dpCodecToHalChannelMode;
using ::bluetooth::audio::aidl::codec::A2dpCodecToHalSampleRate;
using ::bluetooth::audio::aidl::codec::A2dpLdacToHalConfig;
using ::bluetooth::audio::aidl::codec::A2dpOpusToHalConfig;
using ::bluetooth::audio::aidl::codec::A2dpSbcToHalConfig;
using ::bluetooth::audio::aidl::a2dp::BluetoothAudioCtrlAck;
using ::bluetooth::audio::aidl::a2dp::BluetoothAudioSinkClientInterface;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpAacToHalConfig;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpAptxToHalConfig;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpCodecToHalBitsPerSample;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpCodecToHalChannelMode;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpCodecToHalSampleRate;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpLdacToHalConfig;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpOpusToHalConfig;
using ::bluetooth::audio::aidl::a2dp::codec::A2dpSbcToHalConfig;

static BluetoothAudioCtrlAck a2dp_ack_to_bt_audio_ctrl_ack(BluetoothAudioStatus ack) {
  switch (ack) {
@@ -303,7 +303,7 @@ bool update_codec_offloading_capabilities(
  /* Load the provider information if supported by the HAL. */
  provider_info = ::bluetooth::audio::aidl::a2dp::ProviderInfo::GetProviderInfo(
          supports_a2dp_hw_offload_v2);
  return ::bluetooth::audio::aidl::codec::UpdateOffloadingCapabilities(framework_preference);
  return ::bluetooth::audio::aidl::a2dp::codec::UpdateOffloadingCapabilities(framework_preference);
}

// Checking if new bluetooth_audio is enabled
@@ -473,7 +473,7 @@ bool setup_codec(A2dpCodecConfig* a2dp_config, uint16_t peer_mtu,
  }

  bool should_codec_offloading =
          bluetooth::audio::aidl::codec::IsCodecOffloadingEnabled(codec_config);
          bluetooth::audio::aidl::a2dp::codec::IsCodecOffloadingEnabled(codec_config);
  if (should_codec_offloading && !is_hal_offloading()) {
    log::warn("Switching BluetoothAudio HAL to Hardware");
    end_session();
Loading