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

Commit 79be06d8 authored by Henri Chataing's avatar Henri Chataing
Browse files

audio_hal_interface/aidl: Remove message loop from client interfaces

The message loop parameters are unused

Bug: 305734815
Test: m com.android.btservices
Change-Id: I4e8916ebf1f43fdb59b2ee756d21d323ab319728
parent 9759a649
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -405,7 +405,7 @@ bool is_hal_offloading() {
}
}


// Initialize BluetoothAudio HAL: openProvider
// Initialize BluetoothAudio HAL: openProvider
bool init(bluetooth::common::MessageLoopThread* message_loop) {
bool init(bluetooth::common::MessageLoopThread* /*message_loop*/) {
  LOG(INFO) << __func__;
  LOG(INFO) << __func__;


  if (software_hal_interface != nullptr) {
  if (software_hal_interface != nullptr) {
@@ -425,8 +425,7 @@ bool init(bluetooth::common::MessageLoopThread* message_loop) {


  auto a2dp_sink =
  auto a2dp_sink =
      new A2dpTransport(SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH);
      new A2dpTransport(SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH);
  software_hal_interface =
  software_hal_interface = new BluetoothAudioSinkClientInterface(a2dp_sink);
      new BluetoothAudioSinkClientInterface(a2dp_sink, message_loop);
  if (!software_hal_interface->IsValid()) {
  if (!software_hal_interface->IsValid()) {
    LOG(WARNING) << __func__ << ": BluetoothAudio HAL for A2DP is invalid?!";
    LOG(WARNING) << __func__ << ": BluetoothAudio HAL for A2DP is invalid?!";
    delete software_hal_interface;
    delete software_hal_interface;
@@ -438,8 +437,7 @@ bool init(bluetooth::common::MessageLoopThread* message_loop) {
  if (btif_av_is_a2dp_offload_enabled()) {
  if (btif_av_is_a2dp_offload_enabled()) {
    a2dp_sink =
    a2dp_sink =
        new A2dpTransport(SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH);
        new A2dpTransport(SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH);
    offloading_hal_interface =
    offloading_hal_interface = new BluetoothAudioSinkClientInterface(a2dp_sink);
        new BluetoothAudioSinkClientInterface(a2dp_sink, message_loop);
    if (!offloading_hal_interface->IsValid()) {
    if (!offloading_hal_interface->IsValid()) {
      LOG(FATAL) << __func__
      LOG(FATAL) << __func__
                 << ": BluetoothAudio HAL for A2DP offloading is invalid?!";
                 << ": BluetoothAudio HAL for A2DP offloading is invalid?!";
+3 −4
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@
#include <android/binder_manager.h>
#include <android/binder_manager.h>
#include <android_bluetooth_flags.h>
#include <android_bluetooth_flags.h>


#include <thread>
#include <vector>
#include <vector>


#include "include/check.h"
#include "include/check.h"
@@ -238,8 +239,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
}
}


BluetoothAudioSinkClientInterface::BluetoothAudioSinkClientInterface(
BluetoothAudioSinkClientInterface::BluetoothAudioSinkClientInterface(
    IBluetoothSinkTransportInstance* sink,
    IBluetoothSinkTransportInstance* sink)
    bluetooth::common::MessageLoopThread* message_loop)
    : BluetoothAudioClientInterface{sink}, sink_(sink) {
    : BluetoothAudioClientInterface{sink}, sink_(sink) {
  FetchAudioProvider();
  FetchAudioProvider();
}
}
@@ -252,8 +252,7 @@ BluetoothAudioSinkClientInterface::~BluetoothAudioSinkClientInterface() {
}
}


BluetoothAudioSourceClientInterface::BluetoothAudioSourceClientInterface(
BluetoothAudioSourceClientInterface::BluetoothAudioSourceClientInterface(
    IBluetoothSourceTransportInstance* source,
    IBluetoothSourceTransportInstance* source)
    bluetooth::common::MessageLoopThread* message_loop)
    : BluetoothAudioClientInterface{source}, source_(source) {
    : BluetoothAudioClientInterface{source}, source_(source) {
  FetchAudioProvider();
  FetchAudioProvider();
}
}
+4 −10
Original line number Original line Diff line number Diff line
@@ -26,7 +26,6 @@
#include "audio_aidl_interfaces.h"
#include "audio_aidl_interfaces.h"
#include "audio_ctrl_ack.h"
#include "audio_ctrl_ack.h"
#include "bluetooth_audio_port_impl.h"
#include "bluetooth_audio_port_impl.h"
#include "common/message_loop_thread.h"
#include "transport_instance.h"
#include "transport_instance.h"


#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
@@ -195,12 +194,9 @@ class BluetoothAudioSinkClientInterface : public BluetoothAudioClientInterface {
 public:
 public:
  /***
  /***
   * Constructs an BluetoothAudioSinkClientInterface to communicate to
   * Constructs an BluetoothAudioSinkClientInterface to communicate to
   * BluetoothAudio HAL. |sink| is the implementation for the transport, and
   * BluetoothAudio HAL. |sink| is the implementation for the transport.
   * |message_loop| is the thread where callbacks are invoked.
   ***/
   ***/
  BluetoothAudioSinkClientInterface(
  BluetoothAudioSinkClientInterface(IBluetoothSinkTransportInstance* sink);
      IBluetoothSinkTransportInstance* sink,
      bluetooth::common::MessageLoopThread* message_loop);
  virtual ~BluetoothAudioSinkClientInterface();
  virtual ~BluetoothAudioSinkClientInterface();


  IBluetoothSinkTransportInstance* GetTransportInstance() const {
  IBluetoothSinkTransportInstance* GetTransportInstance() const {
@@ -224,12 +220,10 @@ class BluetoothAudioSourceClientInterface
 public:
 public:
  /***
  /***
   * Constructs an BluetoothAudioSourceClientInterface to communicate to
   * Constructs an BluetoothAudioSourceClientInterface to communicate to
   * BluetoothAudio HAL. |source| is the implementation for the transport, and
   * BluetoothAudio HAL. |source| is the implementation for the transport.
   * |message_loop| is the thread where callbacks are invoked.
   ***/
   ***/
  BluetoothAudioSourceClientInterface(
  BluetoothAudioSourceClientInterface(
      IBluetoothSourceTransportInstance* source,
      IBluetoothSourceTransportInstance* source);
      bluetooth::common::MessageLoopThread* message_loop);
  virtual ~BluetoothAudioSourceClientInterface();
  virtual ~BluetoothAudioSourceClientInterface();


  IBluetoothSourceTransportInstance* GetTransportInstance() const {
  IBluetoothSourceTransportInstance* GetTransportInstance() const {
+2 −2
Original line number Original line Diff line number Diff line
@@ -179,7 +179,7 @@ namespace hearing_aid {
bool is_hal_enabled() { return hearing_aid_hal_clientinterface != nullptr; }
bool is_hal_enabled() { return hearing_aid_hal_clientinterface != nullptr; }


bool init(StreamCallbacks stream_cb,
bool init(StreamCallbacks stream_cb,
          bluetooth::common::MessageLoopThread* message_loop) {
          bluetooth::common::MessageLoopThread* /*message_loop*/) {
  LOG(INFO) << __func__;
  LOG(INFO) << __func__;


  if (is_hal_force_disabled()) {
  if (is_hal_force_disabled()) {
@@ -196,7 +196,7 @@ bool init(StreamCallbacks stream_cb,
  hearing_aid_sink = new HearingAidTransport(std::move(stream_cb));
  hearing_aid_sink = new HearingAidTransport(std::move(stream_cb));
  hearing_aid_hal_clientinterface =
  hearing_aid_hal_clientinterface =
      new bluetooth::audio::aidl::BluetoothAudioSinkClientInterface(
      new bluetooth::audio::aidl::BluetoothAudioSinkClientInterface(
          hearing_aid_sink, message_loop);
          hearing_aid_sink);
  if (!hearing_aid_hal_clientinterface->IsValid()) {
  if (!hearing_aid_hal_clientinterface->IsValid()) {
    LOG(WARNING) << __func__
    LOG(WARNING) << __func__
                 << ": BluetoothAudio HAL for Hearing Aid is invalid?!";
                 << ": BluetoothAudio HAL for Hearing Aid is invalid?!";
+0 −1
Original line number Original line Diff line number Diff line
@@ -19,7 +19,6 @@
#include <cstdint>
#include <cstdint>


#include "client_interface_aidl.h"
#include "client_interface_aidl.h"
#include "common/message_loop_thread.h"


namespace bluetooth {
namespace bluetooth {
namespace audio {
namespace audio {
Loading