commit | 9035e139ca7ba5d902d480248d59267979baa4b4 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Feb 09 06:21:19 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Feb 09 06:21:19 2022 +0000 |
tree | de5b91408880c4933ef4857af1f2df433c88a23d | |
parent | ffd1bf2cc8ae2976a9a476b7421869ac138f069d [diff] | |
parent | f256758df4c51811ce89c1e53469c13de9c37d35 [diff] |
Merge "Spatial Audio: Move setLowLatencyModeAllowed from hidl to aidl" am: f256758df4 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1977526 Change-Id: I847f32fd793cb3c99fc55eb914c64119596f8d40
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl index 0dcba2e..6e0bd98 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -39,4 +39,5 @@ void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); + void setLowLatencyModeAllowed(in boolean allowed); }
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl index 6f88f30..ca6f691 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -82,4 +82,12 @@ * encoding. */ void updateAudioConfiguration(in AudioConfiguration audioConfig); + + /** + * Called when the supported latency mode is updated. + * + * @param allowed If the peripheral devices can't keep up with low latency + * mode, the API will be called with supported is false. + */ + void setLowLatencyModeAllowed(in boolean allowed); }
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;