Spatial Audio: Move setLowLatencyModeAllowed from hidl to aidl
Bug: 214615268
Tag: #feature
Test: build
Change-Id: I37d1ae3408d2ca7ce11d917b1173abb56bde8e76
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp b/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
index c2ffa2e..54e82d1 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
@@ -121,6 +121,19 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus BluetoothAudioProvider::setLowLatencyModeAllowed(
+ bool allowed) {
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);
+
+ if (stack_iface_ == nullptr) {
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO session";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ LOG(INFO) << __func__ << " - allowed " << allowed;
+ return ndk::ScopedAStatus::ok();
+}
+
void BluetoothAudioProvider::binderDiedCallbackAidl(void* ptr) {
LOG(ERROR) << __func__ << " - BluetoothAudio Service died";
auto provider = static_cast<BluetoothAudioProvider*>(ptr);
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProvider.h b/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
index f7acbdf..393aaba 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
@@ -46,6 +46,7 @@
ndk::ScopedAStatus streamSuspended(BluetoothAudioStatus status);
ndk::ScopedAStatus updateAudioConfiguration(
const AudioConfiguration& audio_config);
+ ndk::ScopedAStatus setLowLatencyModeAllowed(bool allowed);
virtual bool isValid(const SessionType& sessionType) = 0;