summaryrefslogtreecommitdiff
path: root/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
diff options
context:
space:
mode:
authorChen Chen <cncn@google.com>2022-02-07 18:01:05 -0800
committerChen Chen <cncn@google.com>2022-02-08 02:30:17 +0000
commita4c4c61eed7abfda3b7414e7e4cd383d414dfeb3 (patch)
tree349a199204b34144c3cfeab384424835e435216b /bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
parenta2932530f36825f2e53a268119ffdac07aa1df4b (diff)
Spatial Audio: Add setLatencyMode and setCodecType API with empty
implementation Bug: 216832331 Test: build Tag: #feature Change-Id: I0ccfee39d1f86da81b50f0757de87b6645baacf8
Diffstat (limited to 'bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp')
-rw-r--r--bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index f626db83bd..96cd9ef6cb 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -508,6 +508,36 @@ void BluetoothAudioSession::UpdateSinkMetadata(
}
}
+void BluetoothAudioSession::SetLatencyMode(LatencyMode latency_mode) {
+ std::lock_guard<std::recursive_mutex> guard(mutex_);
+ if (!IsSessionReady()) {
+ LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO session";
+ return;
+ }
+
+ auto hal_retval = stack_iface_->setLatencyMode(latency_mode);
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_) << " failed";
+ }
+}
+
+void BluetoothAudioSession::SetCodecType(CodecType codec_type) {
+ std::lock_guard<std::recursive_mutex> 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 =