SpatialAudio: Export LatencyMode functions to BluetoothAudioSession
BluetoothAudioSession utility supports latency control functions, so
audio_bluetooth_hw can get / set the LatencyMode easily.
Bug: 214615268
Bug: 218708371
Test: build
Tag: #feature
Change-Id: Ia85581c74fc91f406309539755d60d36c173f5e0
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h
index 451a31f..5b838b0 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h
@@ -98,11 +98,12 @@
stop
* stream, to check position, and to update metadata.
***/
- static bool StartStream(const SessionType& session_type) {
+ static bool StartStream(const SessionType& session_type,
+ bool low_latency = false) {
std::shared_ptr<BluetoothAudioSession> session_ptr =
BluetoothAudioSessionInstance::GetSessionInstance(session_type);
if (session_ptr != nullptr) {
- return session_ptr->StartStream();
+ return session_ptr->StartStream(low_latency);
}
return false;
}
@@ -154,6 +155,25 @@
}
}
+ static std::vector<LatencyMode> GetSupportedLatencyModes(
+ const SessionType& session_type) {
+ std::shared_ptr<BluetoothAudioSession> session_ptr =
+ BluetoothAudioSessionInstance::GetSessionInstance(session_type);
+ if (session_ptr != nullptr) {
+ return session_ptr->GetSupportedLatencyModes();
+ }
+ return std::vector<LatencyMode>();
+ }
+
+ static void SetLatencyMode(const SessionType& session_type,
+ const LatencyMode& latency_mode) {
+ std::shared_ptr<BluetoothAudioSession> session_ptr =
+ BluetoothAudioSessionInstance::GetSessionInstance(session_type);
+ if (session_ptr != nullptr) {
+ session_ptr->SetLatencyMode(latency_mode);
+ }
+ }
+
/***
* The control API writes stream to FMQ
***/
@@ -185,4 +205,4 @@
} // namespace bluetooth
} // namespace hardware
} // namespace android
-} // namespace aidl
\ No newline at end of file
+} // namespace aidl