mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
blueooth/audio/aidl/default: Disable GetProviderInfo am: 7f9c47a388
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2957054 Change-Id: Ia8e556e6cc1aa6c8b97ec896fe2ccfed2c36e74e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -120,6 +120,12 @@ ndk::ScopedAStatus A2dpOffloadAudioProvider::onSessionReady(
|
|||||||
ndk::ScopedAStatus A2dpOffloadAudioProvider::parseA2dpConfiguration(
|
ndk::ScopedAStatus A2dpOffloadAudioProvider::parseA2dpConfiguration(
|
||||||
const CodecId& codec_id, const std::vector<uint8_t>& configuration,
|
const CodecId& codec_id, const std::vector<uint8_t>& configuration,
|
||||||
CodecParameters* codec_parameters, A2dpStatus* _aidl_return) {
|
CodecParameters* codec_parameters, A2dpStatus* _aidl_return) {
|
||||||
|
if (!kEnableA2dpCodecExtensibility) {
|
||||||
|
// parseA2dpConfiguration must not be implemented if A2dp codec
|
||||||
|
// extensibility is not supported.
|
||||||
|
return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
|
||||||
|
}
|
||||||
|
|
||||||
auto codec = codec_factory_.GetCodec(codec_id);
|
auto codec = codec_factory_.GetCodec(codec_id);
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
|
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
|
||||||
@@ -136,6 +142,12 @@ ndk::ScopedAStatus A2dpOffloadAudioProvider::getA2dpConfiguration(
|
|||||||
const std::vector<A2dpRemoteCapabilities>& remote_a2dp_capabilities,
|
const std::vector<A2dpRemoteCapabilities>& remote_a2dp_capabilities,
|
||||||
const A2dpConfigurationHint& hint,
|
const A2dpConfigurationHint& hint,
|
||||||
std::optional<audio::A2dpConfiguration>* _aidl_return) {
|
std::optional<audio::A2dpConfiguration>* _aidl_return) {
|
||||||
|
if (!kEnableA2dpCodecExtensibility) {
|
||||||
|
// getA2dpConfiguration must not be implemented if A2dp codec
|
||||||
|
// extensibility is not supported.
|
||||||
|
return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
|
||||||
|
}
|
||||||
|
|
||||||
*_aidl_return = std::nullopt;
|
*_aidl_return = std::nullopt;
|
||||||
A2dpConfiguration avdtp_configuration;
|
A2dpConfiguration avdtp_configuration;
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,23 @@ namespace hardware {
|
|||||||
namespace bluetooth {
|
namespace bluetooth {
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
|
||||||
|
/// Enable flag for the reference implementation for A2dp Codec
|
||||||
|
/// Extensibility.
|
||||||
|
///
|
||||||
|
/// A2dp Codec extensibility cannot be enabled until the following
|
||||||
|
/// requirements are fulfilled.
|
||||||
|
///
|
||||||
|
/// 1. The Bluetooth controller must support the HCI Requirements
|
||||||
|
/// v1.04 or later, and must support the vendor HCI command
|
||||||
|
/// A2DP Offload Start (v2), A2DP Offload Stop (v2) as indicated
|
||||||
|
/// by the field a2dp_offload_v2 of the vendor capabilities.
|
||||||
|
///
|
||||||
|
/// 2. The implementation of the provider must be completed with
|
||||||
|
/// DSP configuration for streaming.
|
||||||
|
enum : bool {
|
||||||
|
kEnableA2dpCodecExtensibility = false,
|
||||||
|
};
|
||||||
|
|
||||||
class BluetoothAudioProvider : public BnBluetoothAudioProvider {
|
class BluetoothAudioProvider : public BnBluetoothAudioProvider {
|
||||||
public:
|
public:
|
||||||
BluetoothAudioProvider();
|
BluetoothAudioProvider();
|
||||||
|
|||||||
@@ -159,6 +159,12 @@ ndk::ScopedAStatus BluetoothAudioProviderFactory::getProviderInfo(
|
|||||||
|
|
||||||
if (session_type == SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
|
if (session_type == SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
|
||||||
session_type == SessionType::A2DP_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
session_type == SessionType::A2DP_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
||||||
|
if (!kEnableA2dpCodecExtensibility) {
|
||||||
|
// Implementing getProviderInfo equates supporting
|
||||||
|
// A2dp codec extensibility.
|
||||||
|
return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
|
||||||
|
}
|
||||||
|
|
||||||
auto& provider_info = _aidl_return->emplace();
|
auto& provider_info = _aidl_return->emplace();
|
||||||
|
|
||||||
provider_info.name = a2dp_offload_codec_factory_.name;
|
provider_info.name = a2dp_offload_codec_factory_.name;
|
||||||
|
|||||||
Reference in New Issue
Block a user