commit | e21832f94de50241c60d98d1be1b505748d2a234 | [log] [tgz] |
---|---|---|
author | Chen Chen <cncn@google.com> | Fri Feb 04 01:48:12 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Feb 04 01:48:12 2022 +0000 |
tree | 4b82debd4084a4b5251db1bdfaa504c365ea2192 | |
parent | d310acf16d3a6e4753df14909134f800a6d08dcb [diff] | |
parent | 39a91ddc70862ee4b2af3e3702822372c412e10d [diff] |
Merge "Spatial Audio: Add audio HAL interface for allowing or disallowing low latency audio" am: dc9bfdd2de am: 5ccb3146c7 am: 0af9666861 am: 39a91ddc70 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1965513 Change-Id: I1ab4b09a7ce0916ba22039f0c95216b1208a615f
diff --git a/bluetooth/audio/2.2/IBluetoothAudioProvider.hal b/bluetooth/audio/2.2/IBluetoothAudioProvider.hal index f577537..7c91805 100644 --- a/bluetooth/audio/2.2/IBluetoothAudioProvider.hal +++ b/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
@@ -69,4 +69,12 @@ * encoding. */ updateAudioConfiguration(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. + */ + setLowLatencyModeAllowed(bool allowed); };
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp b/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp index 202cfb9..62511e9 100644 --- a/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp +++ b/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
@@ -209,6 +209,18 @@ return Void(); } +Return<void> 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 Void(); + } + LOG(INFO) << __func__ << " allowed: " << allowed; + return Void(); +} + } // namespace implementation } // namespace V2_2 } // namespace audio
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvider.h b/bluetooth/audio/2.2/default/BluetoothAudioProvider.h index 425ea3b..90c158e 100644 --- a/bluetooth/audio/2.2/default/BluetoothAudioProvider.h +++ b/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
@@ -56,6 +56,8 @@ Return<void> updateAudioConfiguration( const AudioConfiguration& audioConfig) override; + Return<void> setLowLatencyModeAllowed(bool allowed) override; + protected: sp<BluetoothAudioDeathRecipient> death_recipient_;