Loading system/audio_hal_interface/aidl/a2dp/a2dp_encoding_aidl.cc +10 −26 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ 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::a2dp::BluetoothAudioCtrlAck; using ::bluetooth::audio::aidl::a2dp::BluetoothAudioSinkClientInterface; using ::bluetooth::audio::aidl::a2dp::codec::A2dpAacToHalConfig; using ::bluetooth::audio::aidl::a2dp::codec::A2dpAptxToHalConfig; Loading @@ -68,21 +67,6 @@ 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) { case BluetoothAudioStatus::SUCCESS: return BluetoothAudioCtrlAck::SUCCESS_FINISHED; case BluetoothAudioStatus::PENDING: return BluetoothAudioCtrlAck::PENDING; case BluetoothAudioStatus::UNSUPPORTED_CODEC_CONFIGURATION: return BluetoothAudioCtrlAck::FAILURE_UNSUPPORTED; case BluetoothAudioStatus::UNKNOWN: case BluetoothAudioStatus::FAILURE: default: return BluetoothAudioCtrlAck::FAILURE; } } /*** * * A2dpTransport functions and variables Loading @@ -101,17 +85,17 @@ A2dpTransport::A2dpTransport(SessionType sessionType) remote_delay_report_ = 0; } BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) { BluetoothAudioStatus A2dpTransport::StartRequest(bool is_low_latency) { // Check if a previous Start request is ongoing. if (a2dp_pending_cmd_ == A2DP_CTRL_CMD_START) { log::warn("unable to start stream: already pending"); return BluetoothAudioCtrlAck::PENDING; return BluetoothAudioStatus::PENDING; } // Check if a different request is ongoing. if (a2dp_pending_cmd_ != A2DP_CTRL_CMD_NONE) { log::warn("unable to start stream: busy with pending command {}", a2dp_pending_cmd_); return BluetoothAudioCtrlAck::FAILURE; return BluetoothAudioStatus::FAILURE; } log::info(""); Loading @@ -120,20 +104,20 @@ BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) { a2dp_pending_cmd_ = status == BluetoothAudioStatus::PENDING ? A2DP_CTRL_CMD_START : A2DP_CTRL_CMD_NONE; return a2dp_ack_to_bt_audio_ctrl_ack(status); return status; } BluetoothAudioCtrlAck A2dpTransport::SuspendRequest() { BluetoothAudioStatus A2dpTransport::SuspendRequest() { // Check if a previous Suspend request is ongoing. if (a2dp_pending_cmd_ == A2DP_CTRL_CMD_SUSPEND) { log::warn("unable to suspend stream: already pending"); return BluetoothAudioCtrlAck::PENDING; return BluetoothAudioStatus::PENDING; } // Check if a different request is ongoing. if (a2dp_pending_cmd_ != A2DP_CTRL_CMD_NONE) { log::warn("unable to suspend stream: busy with pending command {}", a2dp_pending_cmd_); return BluetoothAudioCtrlAck::FAILURE; return BluetoothAudioStatus::FAILURE; } log::info(""); Loading @@ -142,7 +126,7 @@ BluetoothAudioCtrlAck A2dpTransport::SuspendRequest() { a2dp_pending_cmd_ = status == BluetoothAudioStatus::PENDING ? A2DP_CTRL_CMD_SUSPEND : A2DP_CTRL_CMD_NONE; return a2dp_ack_to_bt_audio_ctrl_ack(status); return status; } void A2dpTransport::StopRequest() { Loading Loading @@ -534,7 +518,7 @@ void ack_stream_started(BluetoothAudioStatus ack) { auto a2dp_sink = static_cast<A2dpTransport*>(active_hal_interface->GetTransportInstance()); auto pending_cmd = a2dp_sink->GetPendingCmd(); if (pending_cmd == A2DP_CTRL_CMD_START) { active_hal_interface->StreamStarted(a2dp_ack_to_bt_audio_ctrl_ack(ack)); active_hal_interface->StreamStarted(ack); } else { log::warn("pending={} ignore result={}", pending_cmd, ack); return; Loading @@ -553,7 +537,7 @@ void ack_stream_suspended(BluetoothAudioStatus ack) { auto a2dp_sink = static_cast<A2dpTransport*>(active_hal_interface->GetTransportInstance()); auto pending_cmd = a2dp_sink->GetPendingCmd(); if (pending_cmd == A2DP_CTRL_CMD_SUSPEND) { active_hal_interface->StreamSuspended(a2dp_ack_to_bt_audio_ctrl_ack(ack)); active_hal_interface->StreamSuspended(ack); } else if (pending_cmd == A2DP_CTRL_CMD_STOP) { log::info("A2DP_CTRL_CMD_STOP result={}", ack); } else { Loading system/audio_hal_interface/aidl/a2dp/a2dp_transport.h +4 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #include "a2dp_encoding.h" #include "client_interface_aidl.h" typedef enum { Loading @@ -37,6 +38,7 @@ namespace a2dp { namespace { using ::bluetooth::audio::a2dp::BluetoothAudioStatus; using ::bluetooth::audio::aidl::a2dp::LatencyMode; // Provide call-in APIs for the Bluetooth Audio HAL Loading @@ -44,9 +46,9 @@ class A2dpTransport : public ::bluetooth::audio::aidl::a2dp::IBluetoothSinkTrans public: A2dpTransport(SessionType sessionType); BluetoothAudioCtrlAck StartRequest(bool is_low_latency) override; BluetoothAudioStatus StartRequest(bool is_low_latency) override; BluetoothAudioCtrlAck SuspendRequest() override; BluetoothAudioStatus SuspendRequest() override; void StopRequest() override; Loading system/audio_hal_interface/aidl/a2dp/audio_ctrl_ack.hdeleted 100644 → 0 +0 −69 Original line number Diff line number Diff line /* * Copyright 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <bluetooth/log.h> #include "audio_aidl_interfaces.h" namespace bluetooth { namespace audio { namespace aidl { namespace a2dp { enum class BluetoothAudioCtrlAck : uint8_t { SUCCESS_FINISHED = 0, SUCCESS_RECONFIGURATION, PENDING, FAILURE_UNSUPPORTED, FAILURE_BUSY, FAILURE_DISCONNECTING, FAILURE }; std::ostream& operator<<(std::ostream& os, const BluetoothAudioCtrlAck& ack); inline ::aidl::android::hardware::bluetooth::audio::BluetoothAudioStatus BluetoothAudioCtrlAckToHalStatus(const BluetoothAudioCtrlAck& ack) { using ::aidl::android::hardware::bluetooth::audio::BluetoothAudioStatus; switch (ack) { case BluetoothAudioCtrlAck::SUCCESS_FINISHED: return BluetoothAudioStatus::SUCCESS; case BluetoothAudioCtrlAck::FAILURE_UNSUPPORTED: return BluetoothAudioStatus::UNSUPPORTED_CODEC_CONFIGURATION; case BluetoothAudioCtrlAck::PENDING: return BluetoothAudioStatus::FAILURE; case BluetoothAudioCtrlAck::FAILURE_BUSY: return BluetoothAudioStatus::FAILURE; case BluetoothAudioCtrlAck::FAILURE_DISCONNECTING: return BluetoothAudioStatus::FAILURE; case BluetoothAudioCtrlAck::SUCCESS_RECONFIGURATION: return BluetoothAudioStatus::RECONFIGURATION; default: return BluetoothAudioStatus::FAILURE; } } } // namespace a2dp } // namespace aidl } // namespace audio } // namespace bluetooth namespace fmt { template <> struct formatter<bluetooth::audio::aidl::a2dp::BluetoothAudioCtrlAck> : ostream_formatter {}; } // namespace fmt system/audio_hal_interface/aidl/a2dp/bluetooth_audio_port_impl.cc +7 −6 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <vector> #include "client_interface_aidl.h" #include "android/binder_ibinder_platform.h" #include "btif/include/btif_common.h" #include "common/stop_watch_legacy.h" Loading @@ -41,9 +42,9 @@ BluetoothAudioPortImpl::~BluetoothAudioPortImpl() {} ndk::ScopedAStatus BluetoothAudioPortImpl::startStream(bool is_low_latency) { StopWatchLegacy stop_watch(__func__); BluetoothAudioCtrlAck ack = transport_instance_->StartRequest(is_low_latency); if (ack != BluetoothAudioCtrlAck::PENDING) { auto aidl_retval = provider_->streamStarted(BluetoothAudioCtrlAckToHalStatus(ack)); BluetoothAudioStatus ack = transport_instance_->StartRequest(is_low_latency); if (ack != BluetoothAudioStatus::PENDING) { auto aidl_retval = provider_->streamStarted(BluetoothAudioStatusToHalStatus(ack)); if (!aidl_retval.isOk()) { log::error("BluetoothAudioHal failure: {}", aidl_retval.getDescription()); } Loading @@ -53,9 +54,9 @@ ndk::ScopedAStatus BluetoothAudioPortImpl::startStream(bool is_low_latency) { ndk::ScopedAStatus BluetoothAudioPortImpl::suspendStream() { StopWatchLegacy stop_watch(__func__); BluetoothAudioCtrlAck ack = transport_instance_->SuspendRequest(); if (ack != BluetoothAudioCtrlAck::PENDING) { auto aidl_retval = provider_->streamSuspended(BluetoothAudioCtrlAckToHalStatus(ack)); BluetoothAudioStatus ack = transport_instance_->SuspendRequest(); if (ack != BluetoothAudioStatus::PENDING) { auto aidl_retval = provider_->streamSuspended(BluetoothAudioStatusToHalStatus(ack)); if (!aidl_retval.isOk()) { log::error("BluetoothAudioHal failure: {}", aidl_retval.getDescription()); } Loading system/audio_hal_interface/aidl/a2dp/client_interface_aidl.cc +6 −25 Original line number Diff line number Diff line Loading @@ -37,25 +37,6 @@ namespace audio { namespace aidl { namespace a2dp { std::ostream& operator<<(std::ostream& os, const BluetoothAudioCtrlAck& ack) { switch (ack) { case BluetoothAudioCtrlAck::SUCCESS_FINISHED: return os << "SUCCESS_FINISHED"; case BluetoothAudioCtrlAck::PENDING: return os << "PENDING"; case BluetoothAudioCtrlAck::FAILURE_UNSUPPORTED: return os << "FAILURE_UNSUPPORTED"; case BluetoothAudioCtrlAck::FAILURE_BUSY: return os << "FAILURE_BUSY"; case BluetoothAudioCtrlAck::FAILURE_DISCONNECTING: return os << "FAILURE_DISCONNECTING"; case BluetoothAudioCtrlAck::FAILURE: return os << "FAILURE"; default: return os << "UNDEFINED " << static_cast<int8_t>(ack); } } BluetoothAudioClientInterface::BluetoothAudioClientInterface(IBluetoothTransportInstance* instance) : provider_(nullptr), provider_factory_(nullptr), Loading Loading @@ -431,17 +412,17 @@ int BluetoothAudioClientInterface::StartSession() { } } void BluetoothAudioClientInterface::StreamStarted(const BluetoothAudioCtrlAck& ack) { void BluetoothAudioClientInterface::StreamStarted(const BluetoothAudioStatus& ack) { if (provider_ == nullptr) { log::error("BluetoothAudioHal nullptr"); return; } if (ack == BluetoothAudioCtrlAck::PENDING) { if (ack == BluetoothAudioStatus::PENDING) { log::info("{} ignored", ack); return; } auto status = BluetoothAudioCtrlAckToHalStatus(ack); auto status = BluetoothAudioStatusToHalStatus(ack); auto aidl_retval = provider_->streamStarted(status); if (!aidl_retval.isOk()) { Loading @@ -449,17 +430,17 @@ void BluetoothAudioClientInterface::StreamStarted(const BluetoothAudioCtrlAck& a } } void BluetoothAudioClientInterface::StreamSuspended(const BluetoothAudioCtrlAck& ack) { void BluetoothAudioClientInterface::StreamSuspended(const BluetoothAudioStatus& ack) { if (provider_ == nullptr) { log::error("BluetoothAudioHal nullptr"); return; } if (ack == BluetoothAudioCtrlAck::PENDING) { if (ack == BluetoothAudioStatus::PENDING) { log::info("{} ignored", ack); return; } auto status = BluetoothAudioCtrlAckToHalStatus(ack); auto status = BluetoothAudioStatusToHalStatus(ack); auto aidl_retval = provider_->streamSuspended(status); if (!aidl_retval.isOk()) { Loading Loading
system/audio_hal_interface/aidl/a2dp/a2dp_encoding_aidl.cc +10 −26 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ 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::a2dp::BluetoothAudioCtrlAck; using ::bluetooth::audio::aidl::a2dp::BluetoothAudioSinkClientInterface; using ::bluetooth::audio::aidl::a2dp::codec::A2dpAacToHalConfig; using ::bluetooth::audio::aidl::a2dp::codec::A2dpAptxToHalConfig; Loading @@ -68,21 +67,6 @@ 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) { case BluetoothAudioStatus::SUCCESS: return BluetoothAudioCtrlAck::SUCCESS_FINISHED; case BluetoothAudioStatus::PENDING: return BluetoothAudioCtrlAck::PENDING; case BluetoothAudioStatus::UNSUPPORTED_CODEC_CONFIGURATION: return BluetoothAudioCtrlAck::FAILURE_UNSUPPORTED; case BluetoothAudioStatus::UNKNOWN: case BluetoothAudioStatus::FAILURE: default: return BluetoothAudioCtrlAck::FAILURE; } } /*** * * A2dpTransport functions and variables Loading @@ -101,17 +85,17 @@ A2dpTransport::A2dpTransport(SessionType sessionType) remote_delay_report_ = 0; } BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) { BluetoothAudioStatus A2dpTransport::StartRequest(bool is_low_latency) { // Check if a previous Start request is ongoing. if (a2dp_pending_cmd_ == A2DP_CTRL_CMD_START) { log::warn("unable to start stream: already pending"); return BluetoothAudioCtrlAck::PENDING; return BluetoothAudioStatus::PENDING; } // Check if a different request is ongoing. if (a2dp_pending_cmd_ != A2DP_CTRL_CMD_NONE) { log::warn("unable to start stream: busy with pending command {}", a2dp_pending_cmd_); return BluetoothAudioCtrlAck::FAILURE; return BluetoothAudioStatus::FAILURE; } log::info(""); Loading @@ -120,20 +104,20 @@ BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) { a2dp_pending_cmd_ = status == BluetoothAudioStatus::PENDING ? A2DP_CTRL_CMD_START : A2DP_CTRL_CMD_NONE; return a2dp_ack_to_bt_audio_ctrl_ack(status); return status; } BluetoothAudioCtrlAck A2dpTransport::SuspendRequest() { BluetoothAudioStatus A2dpTransport::SuspendRequest() { // Check if a previous Suspend request is ongoing. if (a2dp_pending_cmd_ == A2DP_CTRL_CMD_SUSPEND) { log::warn("unable to suspend stream: already pending"); return BluetoothAudioCtrlAck::PENDING; return BluetoothAudioStatus::PENDING; } // Check if a different request is ongoing. if (a2dp_pending_cmd_ != A2DP_CTRL_CMD_NONE) { log::warn("unable to suspend stream: busy with pending command {}", a2dp_pending_cmd_); return BluetoothAudioCtrlAck::FAILURE; return BluetoothAudioStatus::FAILURE; } log::info(""); Loading @@ -142,7 +126,7 @@ BluetoothAudioCtrlAck A2dpTransport::SuspendRequest() { a2dp_pending_cmd_ = status == BluetoothAudioStatus::PENDING ? A2DP_CTRL_CMD_SUSPEND : A2DP_CTRL_CMD_NONE; return a2dp_ack_to_bt_audio_ctrl_ack(status); return status; } void A2dpTransport::StopRequest() { Loading Loading @@ -534,7 +518,7 @@ void ack_stream_started(BluetoothAudioStatus ack) { auto a2dp_sink = static_cast<A2dpTransport*>(active_hal_interface->GetTransportInstance()); auto pending_cmd = a2dp_sink->GetPendingCmd(); if (pending_cmd == A2DP_CTRL_CMD_START) { active_hal_interface->StreamStarted(a2dp_ack_to_bt_audio_ctrl_ack(ack)); active_hal_interface->StreamStarted(ack); } else { log::warn("pending={} ignore result={}", pending_cmd, ack); return; Loading @@ -553,7 +537,7 @@ void ack_stream_suspended(BluetoothAudioStatus ack) { auto a2dp_sink = static_cast<A2dpTransport*>(active_hal_interface->GetTransportInstance()); auto pending_cmd = a2dp_sink->GetPendingCmd(); if (pending_cmd == A2DP_CTRL_CMD_SUSPEND) { active_hal_interface->StreamSuspended(a2dp_ack_to_bt_audio_ctrl_ack(ack)); active_hal_interface->StreamSuspended(ack); } else if (pending_cmd == A2DP_CTRL_CMD_STOP) { log::info("A2DP_CTRL_CMD_STOP result={}", ack); } else { Loading
system/audio_hal_interface/aidl/a2dp/a2dp_transport.h +4 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #include "a2dp_encoding.h" #include "client_interface_aidl.h" typedef enum { Loading @@ -37,6 +38,7 @@ namespace a2dp { namespace { using ::bluetooth::audio::a2dp::BluetoothAudioStatus; using ::bluetooth::audio::aidl::a2dp::LatencyMode; // Provide call-in APIs for the Bluetooth Audio HAL Loading @@ -44,9 +46,9 @@ class A2dpTransport : public ::bluetooth::audio::aidl::a2dp::IBluetoothSinkTrans public: A2dpTransport(SessionType sessionType); BluetoothAudioCtrlAck StartRequest(bool is_low_latency) override; BluetoothAudioStatus StartRequest(bool is_low_latency) override; BluetoothAudioCtrlAck SuspendRequest() override; BluetoothAudioStatus SuspendRequest() override; void StopRequest() override; Loading
system/audio_hal_interface/aidl/a2dp/audio_ctrl_ack.hdeleted 100644 → 0 +0 −69 Original line number Diff line number Diff line /* * Copyright 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <bluetooth/log.h> #include "audio_aidl_interfaces.h" namespace bluetooth { namespace audio { namespace aidl { namespace a2dp { enum class BluetoothAudioCtrlAck : uint8_t { SUCCESS_FINISHED = 0, SUCCESS_RECONFIGURATION, PENDING, FAILURE_UNSUPPORTED, FAILURE_BUSY, FAILURE_DISCONNECTING, FAILURE }; std::ostream& operator<<(std::ostream& os, const BluetoothAudioCtrlAck& ack); inline ::aidl::android::hardware::bluetooth::audio::BluetoothAudioStatus BluetoothAudioCtrlAckToHalStatus(const BluetoothAudioCtrlAck& ack) { using ::aidl::android::hardware::bluetooth::audio::BluetoothAudioStatus; switch (ack) { case BluetoothAudioCtrlAck::SUCCESS_FINISHED: return BluetoothAudioStatus::SUCCESS; case BluetoothAudioCtrlAck::FAILURE_UNSUPPORTED: return BluetoothAudioStatus::UNSUPPORTED_CODEC_CONFIGURATION; case BluetoothAudioCtrlAck::PENDING: return BluetoothAudioStatus::FAILURE; case BluetoothAudioCtrlAck::FAILURE_BUSY: return BluetoothAudioStatus::FAILURE; case BluetoothAudioCtrlAck::FAILURE_DISCONNECTING: return BluetoothAudioStatus::FAILURE; case BluetoothAudioCtrlAck::SUCCESS_RECONFIGURATION: return BluetoothAudioStatus::RECONFIGURATION; default: return BluetoothAudioStatus::FAILURE; } } } // namespace a2dp } // namespace aidl } // namespace audio } // namespace bluetooth namespace fmt { template <> struct formatter<bluetooth::audio::aidl::a2dp::BluetoothAudioCtrlAck> : ostream_formatter {}; } // namespace fmt
system/audio_hal_interface/aidl/a2dp/bluetooth_audio_port_impl.cc +7 −6 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <vector> #include "client_interface_aidl.h" #include "android/binder_ibinder_platform.h" #include "btif/include/btif_common.h" #include "common/stop_watch_legacy.h" Loading @@ -41,9 +42,9 @@ BluetoothAudioPortImpl::~BluetoothAudioPortImpl() {} ndk::ScopedAStatus BluetoothAudioPortImpl::startStream(bool is_low_latency) { StopWatchLegacy stop_watch(__func__); BluetoothAudioCtrlAck ack = transport_instance_->StartRequest(is_low_latency); if (ack != BluetoothAudioCtrlAck::PENDING) { auto aidl_retval = provider_->streamStarted(BluetoothAudioCtrlAckToHalStatus(ack)); BluetoothAudioStatus ack = transport_instance_->StartRequest(is_low_latency); if (ack != BluetoothAudioStatus::PENDING) { auto aidl_retval = provider_->streamStarted(BluetoothAudioStatusToHalStatus(ack)); if (!aidl_retval.isOk()) { log::error("BluetoothAudioHal failure: {}", aidl_retval.getDescription()); } Loading @@ -53,9 +54,9 @@ ndk::ScopedAStatus BluetoothAudioPortImpl::startStream(bool is_low_latency) { ndk::ScopedAStatus BluetoothAudioPortImpl::suspendStream() { StopWatchLegacy stop_watch(__func__); BluetoothAudioCtrlAck ack = transport_instance_->SuspendRequest(); if (ack != BluetoothAudioCtrlAck::PENDING) { auto aidl_retval = provider_->streamSuspended(BluetoothAudioCtrlAckToHalStatus(ack)); BluetoothAudioStatus ack = transport_instance_->SuspendRequest(); if (ack != BluetoothAudioStatus::PENDING) { auto aidl_retval = provider_->streamSuspended(BluetoothAudioStatusToHalStatus(ack)); if (!aidl_retval.isOk()) { log::error("BluetoothAudioHal failure: {}", aidl_retval.getDescription()); } Loading
system/audio_hal_interface/aidl/a2dp/client_interface_aidl.cc +6 −25 Original line number Diff line number Diff line Loading @@ -37,25 +37,6 @@ namespace audio { namespace aidl { namespace a2dp { std::ostream& operator<<(std::ostream& os, const BluetoothAudioCtrlAck& ack) { switch (ack) { case BluetoothAudioCtrlAck::SUCCESS_FINISHED: return os << "SUCCESS_FINISHED"; case BluetoothAudioCtrlAck::PENDING: return os << "PENDING"; case BluetoothAudioCtrlAck::FAILURE_UNSUPPORTED: return os << "FAILURE_UNSUPPORTED"; case BluetoothAudioCtrlAck::FAILURE_BUSY: return os << "FAILURE_BUSY"; case BluetoothAudioCtrlAck::FAILURE_DISCONNECTING: return os << "FAILURE_DISCONNECTING"; case BluetoothAudioCtrlAck::FAILURE: return os << "FAILURE"; default: return os << "UNDEFINED " << static_cast<int8_t>(ack); } } BluetoothAudioClientInterface::BluetoothAudioClientInterface(IBluetoothTransportInstance* instance) : provider_(nullptr), provider_factory_(nullptr), Loading Loading @@ -431,17 +412,17 @@ int BluetoothAudioClientInterface::StartSession() { } } void BluetoothAudioClientInterface::StreamStarted(const BluetoothAudioCtrlAck& ack) { void BluetoothAudioClientInterface::StreamStarted(const BluetoothAudioStatus& ack) { if (provider_ == nullptr) { log::error("BluetoothAudioHal nullptr"); return; } if (ack == BluetoothAudioCtrlAck::PENDING) { if (ack == BluetoothAudioStatus::PENDING) { log::info("{} ignored", ack); return; } auto status = BluetoothAudioCtrlAckToHalStatus(ack); auto status = BluetoothAudioStatusToHalStatus(ack); auto aidl_retval = provider_->streamStarted(status); if (!aidl_retval.isOk()) { Loading @@ -449,17 +430,17 @@ void BluetoothAudioClientInterface::StreamStarted(const BluetoothAudioCtrlAck& a } } void BluetoothAudioClientInterface::StreamSuspended(const BluetoothAudioCtrlAck& ack) { void BluetoothAudioClientInterface::StreamSuspended(const BluetoothAudioStatus& ack) { if (provider_ == nullptr) { log::error("BluetoothAudioHal nullptr"); return; } if (ack == BluetoothAudioCtrlAck::PENDING) { if (ack == BluetoothAudioStatus::PENDING) { log::info("{} ignored", ack); return; } auto status = BluetoothAudioCtrlAckToHalStatus(ack); auto status = BluetoothAudioStatusToHalStatus(ack); auto aidl_retval = provider_->streamSuspended(status); if (!aidl_retval.isOk()) { Loading