From 359bf320913ed7f6265b3380ca57a8d5345710da Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Fri, 11 Feb 2022 12:25:20 -0800 Subject: [PATCH] SpatialAudio: Remove codec interface from audio HAL. Codec switch logic will be inside Bluetooth Bug: 214615268 Test: Build Tag: #feature Change-Id: Ic2a997614e16abfd745c80dc87ecf5d340497691 --- .../bluetooth/audio/IBluetoothAudioPort.aidl | 1 - .../bluetooth/audio/IBluetoothAudioPort.aidl | 7 ------- .../utils/aidl_session/BluetoothAudioSession.cpp | 15 --------------- .../utils/aidl_session/BluetoothAudioSession.h | 1 - 4 files changed, 24 deletions(-) diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl index cc3c6419de..0033fee41e 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -41,5 +41,4 @@ interface IBluetoothAudioPort { void updateSourceMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); void updateSinkMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata); void setLatencyMode(in android.hardware.bluetooth.audio.LatencyMode latencyMode); - void setCodecType(in android.hardware.bluetooth.audio.CodecType codecType); } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl index 81c2ce29cd..9f8007beaa 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -87,11 +87,4 @@ interface IBluetoothAudioPort { * @param latencyMode latency mode from audio */ void setLatencyMode(in LatencyMode latencyMode); - - /** - * Called when codec type is changed. - * - * @param codecType codec type from audio - */ - void setCodecType(in CodecType codecType); } diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp index 96cd9ef6cb..0590ec614b 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp @@ -523,21 +523,6 @@ void BluetoothAudioSession::SetLatencyMode(LatencyMode latency_mode) { } } -void BluetoothAudioSession::SetCodecType(CodecType codec_type) { - std::lock_guard guard(mutex_); - if (!IsSessionReady()) { - LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_) - << " has NO session"; - return; - } - - auto hal_retval = stack_iface_->setCodecType(codec_type); - if (!hal_retval.isOk()) { - LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType=" - << toString(session_type_) << " failed"; - } -} - bool BluetoothAudioSession::IsAidlAvailable() { if (is_aidl_checked) return is_aidl_available; is_aidl_available = diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h index 5adc0e2f89..5fbafd1fb6 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h @@ -166,7 +166,6 @@ class BluetoothAudioSession { void UpdateSourceMetadata(const struct source_metadata& source_metadata); void UpdateSinkMetadata(const struct sink_metadata& sink_metadata); void SetLatencyMode(LatencyMode latency_mode); - void SetCodecType(CodecType codec_type); // The control function writes stream to FMQ size_t OutWritePcmData(const void* buffer, size_t bytes);