Merge "audio: Add supportsBluetoothVariableLatency API to IModule" am: 91ca65c35c

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2388415

Change-Id: I7557aa97b92492bc93791144f74f6621bb3c92c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-01-19 10:36:13 +00:00
committed by Automerger Merge Worker
6 changed files with 29 additions and 2 deletions

View File

@@ -69,6 +69,7 @@ interface IModule {
void addDeviceEffect(int portConfigId, in android.hardware.audio.effect.IEffect effect);
void removeDeviceEffect(int portConfigId, in android.hardware.audio.effect.IEffect effect);
android.media.audio.common.AudioMMapPolicyInfo[] getMmapPolicyInfos(android.media.audio.common.AudioMMapPolicyType mmapPolicyType);
boolean supportsVariableLatency();
@VintfStability
parcelable OpenInputStreamArguments {
int portConfigId;

View File

@@ -822,4 +822,15 @@ interface IModule {
* @return The vector with mmap policy information.
*/
AudioMMapPolicyInfo[] getMmapPolicyInfos(AudioMMapPolicyType mmapPolicyType);
/**
* Indicates if this module supports variable latency control for instance
* over Bluetooth A2DP or LE Audio links.
*
* If supported, all instances of IStreamOut interface returned by this module must
* implement getRecommendedLatencyModes() and setLatencyMode() APIs.
*
* @return Whether the module supports variable latency control.
*/
boolean supportsVariableLatency();
}

View File

@@ -157,7 +157,8 @@ interface IStreamOut {
*
* Implementation for this method is mandatory only on specific spatial
* audio streams indicated by AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can
* be routed to a BT classic sink.
* be routed to a BT sinks or if the implementation indicates support
* on all streams via IModule.supportsVariableLatency().
*
* @return Currently supported latency modes.
* @throws EX_ILLEGAL_STATE If the stream is closed.
@@ -172,7 +173,8 @@ interface IStreamOut {
*
* Implementation for this method is mandatory only on specific spatial
* audio streams indicated by AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can
* be routed to a BT classic sink.
* be routed to a BT sinks or if the implementation indicates support
* on all streams via IModule.supportsVariableLatency().
*
* @throws EX_ILLEGAL_ARGUMENT If the specified mode is not supported.
* @throws EX_ILLEGAL_STATE If the stream is closed.

View File

@@ -1145,4 +1145,10 @@ ndk::ScopedAStatus Module::getMmapPolicyInfos(AudioMMapPolicyType mmapPolicyType
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::supportsVariableLatency(bool* _aidl_return) {
LOG(DEBUG) << __func__;
*_aidl_return = false;
return ndk::ScopedAStatus::ok();
}
} // namespace aidl::android::hardware::audio::core

View File

@@ -114,6 +114,7 @@ class Module : public BnModule {
::aidl::android::media::audio::common::AudioMMapPolicyType mmapPolicyType,
std::vector<::aidl::android::media::audio::common::AudioMMapPolicyInfo>* _aidl_return)
override;
ndk::ScopedAStatus supportsVariableLatency(bool* _aidl_return) override;
void cleanUpPatch(int32_t patchId);
ndk::ScopedAStatus createStreamContext(

View File

@@ -1907,6 +1907,12 @@ TEST_P(AudioCoreModule, GetMmapPolicyInfos) {
}
}
TEST_P(AudioCoreModule, BluetoothVariableLatency) {
bool isSupported = false;
EXPECT_IS_OK(module->supportsVariableLatency(&isSupported));
LOG(INFO) << "supportsVariableLatency: " << isSupported;
}
class AudioCoreBluetooth : public AudioCoreModuleBase, public testing::TestWithParam<std::string> {
public:
void SetUp() override {