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

Commit d245e0fb authored by Henri Chataing's avatar Henri Chataing
Browse files

system/audio_hal_interface/Android.bp: Enforce -Wunused-parameter

Bug: 299772495
Test: m com.android.btservices
Flag: EXEMPT, mechanical refactor
Change-Id: I05abbbb8a62cbb8eab1375a94e9b1c1c37745bf8
parent f34fcc41
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ cc_library_static {
    },
    host_supported: true,
    cflags: [
        "-Wno-unused-parameter",
        "-Wthread-safety",
    ],
    apex_available: [
@@ -140,7 +139,6 @@ cc_test {
    ],
    cflags: [
        "-DUNIT_TESTS",
        "-Wno-unused-parameter",
    ],
    host_supported: true,
    test_options: {
@@ -381,6 +379,5 @@ cc_test {
    header_libs: ["libbluetooth_headers"],
    cflags: [
        "-DBUILDCFG",
        "-Wno-unused-parameter",
    ],
}
+17 −17
Original line number Diff line number Diff line
@@ -216,8 +216,8 @@ void set_remote_delay(uint16_t delay_report) { remote_delay_report_ = delay_repo

// Inform audio server about offloading codec; not used for now
bool update_codec_offloading_capabilities(
        const std::vector<btav_a2dp_codec_config_t>& framework_preference,
        bool supports_a2dp_hw_offload_v2) {
        const std::vector<btav_a2dp_codec_config_t>& /*framework_preference*/,
        bool /*supports_a2dp_hw_offload_v2*/) {
  return false;
}

@@ -231,8 +231,8 @@ static BluetoothAudioPort null_audio_port;
static BluetoothAudioPort const* bluetooth_audio_port = &null_audio_port;

// Initialize BluetoothAudio HAL: openProvider
bool init(bluetooth::common::MessageLoopThread* message_loop, BluetoothAudioPort const* audio_port,
          bool /*offload_enabled*/) {
bool init(bluetooth::common::MessageLoopThread* /*message_loop*/,
          BluetoothAudioPort const* audio_port, bool /*offload_enabled*/) {
  a2dp_uipc = UIPC_Init();
  total_bytes_read_ = 0;
  data_position_ = {};
@@ -273,7 +273,7 @@ void end_session() {
  a2dp_pending_cmd_ = A2DP_CTRL_CMD_NONE;
}

void set_audio_low_latency_mode_allowed(bool allowed) {}
void set_audio_low_latency_mode_allowed(bool /*allowed*/) {}

void ack_stream_started(BluetoothAudioStatus /*ack*/) {
  a2dp_pending_cmd_ = A2DP_CTRL_CMD_NONE;
@@ -305,12 +305,12 @@ bool is_opus_supported() { return true; }
namespace provider {

// Lookup the codec info in the list of supported offloaded sink codecs.
std::optional<btav_a2dp_codec_index_t> sink_codec_index(const uint8_t* p_codec_info) {
std::optional<btav_a2dp_codec_index_t> sink_codec_index(const uint8_t* /*p_codec_info*/) {
  return std::nullopt;
}

// Lookup the codec info in the list of supported offloaded source codecs.
std::optional<btav_a2dp_codec_index_t> source_codec_index(const uint8_t* p_codec_info) {
std::optional<btav_a2dp_codec_index_t> source_codec_index(const uint8_t* /*p_codec_info*/) {
  return std::nullopt;
}

@@ -320,17 +320,17 @@ std::optional<btav_a2dp_codec_index_t> source_codec_index(const uint8_t* p_codec
// BTAV_A2DP_CODEC_INDEX_SOURCE_EXT_MIN..BTAV_A2DP_CODEC_INDEX_SOURCE_EXT_MAX.
// Returns nullopt if the codec_index is not assigned or codec extensibility
// is not supported or enabled.
std::optional<const char*> codec_index_str(btav_a2dp_codec_index_t codec_index) {
std::optional<const char*> codec_index_str(btav_a2dp_codec_index_t /*codec_index*/) {
  return std::nullopt;
}

// Return true if the codec is supported for the session type
// A2DP_HARDWARE_ENCODING_DATAPATH or A2DP_HARDWARE_DECODING_DATAPATH.
bool supports_codec(btav_a2dp_codec_index_t codec_index) { return false; }
bool supports_codec(btav_a2dp_codec_index_t /*codec_index*/) { return false; }

// Return the A2DP capabilities for the selected codec.
bool codec_info(btav_a2dp_codec_index_t codec_index, uint64_t* codec_id, uint8_t* codec_info,
                btav_a2dp_codec_config_t* codec_config) {
bool codec_info(btav_a2dp_codec_index_t /*codec_index*/, uint64_t* /*codec_id*/,
                uint8_t* /*codec_info*/, btav_a2dp_codec_config_t* /*codec_config*/) {
  return false;
}

@@ -338,8 +338,8 @@ bool codec_info(btav_a2dp_codec_index_t codec_index, uint64_t* codec_id, uint8_t
// The HAL is expected to pick the best audio configuration based on the
// discovered remote SEPs.
std::optional<a2dp_configuration> get_a2dp_configuration(
        RawAddress peer_address, std::vector<a2dp_remote_capabilities> const& remote_seps,
        btav_a2dp_codec_config_t const& user_preferences) {
        RawAddress /*peer_address*/, std::vector<a2dp_remote_capabilities> const& /*remote_seps*/,
        btav_a2dp_codec_config_t const& /*user_preferences*/) {
  return std::nullopt;
}

@@ -350,10 +350,10 @@ std::optional<a2dp_configuration> get_a2dp_configuration(
// In case any of these checks fails, the corresponding A2DP
// status is returned. If the configuration is valid and supported,
// A2DP_OK is returned.
tA2DP_STATUS parse_a2dp_configuration(btav_a2dp_codec_index_t codec_index,
                                      const uint8_t* codec_info,
                                      btav_a2dp_codec_config_t* codec_parameters,
                                      std::vector<uint8_t>* vendor_specific_parameters) {
tA2DP_STATUS parse_a2dp_configuration(btav_a2dp_codec_index_t /*codec_index*/,
                                      const uint8_t* /*codec_info*/,
                                      btav_a2dp_codec_config_t* /*codec_parameters*/,
                                      std::vector<uint8_t>* /*vendor_specific_parameters*/) {
  return A2DP_FAIL;
}

+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public:
        total_bytes_read_(0),
        data_position_({}) {}

  BluetoothAudioCtrlAck StartRequest(bool is_low_latency) override {
  BluetoothAudioCtrlAck StartRequest(bool /*is_low_latency*/) override {
    log::info("");
    if (stream_cb_.on_resume_(true)) {
      return BluetoothAudioCtrlAck::SUCCESS_FINISHED;
@@ -83,7 +83,7 @@ public:
    }
  }

  void SetLatencyMode(LatencyMode latency_mode) override {}
  void SetLatencyMode(LatencyMode /*latency_mode*/) override {}

  bool GetPresentationPosition(uint64_t* remote_delay_report_ns, uint64_t* total_bytes_read,
                               timespec* data_position) override {
+8 −7
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ void HfpTransport::ResetPendingCmd() { hfp_pending_cmd_ = HFP_CTRL_CMD_NONE; }
uint8_t HfpTransport::GetPendingCmd() const { return hfp_pending_cmd_; }

// Unimplemented functions
void HfpTransport::LogBytesProcessed(size_t bytes_read) {}
void HfpTransport::LogBytesProcessed(size_t /*bytes_read*/) {}

BluetoothAudioCtrlAck HfpTransport::SuspendRequest() {
  log::info("handling");
@@ -209,16 +209,17 @@ BluetoothAudioCtrlAck HfpTransport::SuspendRequest() {
  }
}

void HfpTransport::SetLatencyMode(LatencyMode latency_mode) {}
void HfpTransport::SetLatencyMode(LatencyMode /*latency_mode*/) {}

void HfpTransport::SourceMetadataChanged(const source_metadata_v7_t& source_metadata) {}
void HfpTransport::SourceMetadataChanged(const source_metadata_v7_t& /*source_metadata*/) {}

void HfpTransport::SinkMetadataChanged(const sink_metadata_v7_t&) {}

void HfpTransport::ResetPresentationPosition() {}

bool HfpTransport::GetPresentationPosition(uint64_t* remote_delay_report_ns,
                                           uint64_t* total_bytes_read, timespec* data_position) {
bool HfpTransport::GetPresentationPosition(uint64_t* /*remote_delay_report_ns*/,
                                           uint64_t* /*total_bytes_read*/,
                                           timespec* /*data_position*/) {
  return false;
}

@@ -230,7 +231,7 @@ HfpDecodingTransport::HfpDecodingTransport(SessionType session_type)

HfpDecodingTransport::~HfpDecodingTransport() { delete transport_; }

BluetoothAudioCtrlAck HfpDecodingTransport::StartRequest(bool is_low_latency) {
BluetoothAudioCtrlAck HfpDecodingTransport::StartRequest(bool /*is_low_latency*/) {
  return transport_->StartRequest();
}

@@ -285,7 +286,7 @@ HfpEncodingTransport::HfpEncodingTransport(SessionType session_type)

HfpEncodingTransport::~HfpEncodingTransport() { delete transport_; }

BluetoothAudioCtrlAck HfpEncodingTransport::StartRequest(bool is_low_latency) {
BluetoothAudioCtrlAck HfpEncodingTransport::StartRequest(bool /*is_low_latency*/) {
  return transport_->StartRequest();
}

+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ namespace hearing_aid {

bool is_hal_enabled() { return false; }

bool init(StreamCallbacks stream_cb, bluetooth::common::MessageLoopThread* message_loop) {
bool init(StreamCallbacks /*stream_cb*/, bluetooth::common::MessageLoopThread* /*message_loop*/) {
  return false;
}

@@ -32,9 +32,9 @@ void start_session() {}

void end_session() {}

size_t read(uint8_t* p_buf, uint32_t len) { return 0; }
size_t read(uint8_t* /*p_buf*/, uint32_t /*len*/) { return 0; }

void set_remote_delay(uint16_t delay_report_ms) {}
void set_remote_delay(uint16_t /*delay_report_ms*/) {}

}  // namespace hearing_aid
}  // namespace audio
Loading