Effect Aidl: skipping reopen test for unsupported audio hal
Bug: 327678656
Bug: 328009824
Test: atest VtsHalAudioEffectTargetTest
Change-Id: I25a27c780253f84f771148b5c30be57f35dbf39c
diff --git a/audio/aidl/vts/EffectFactoryHelper.h b/audio/aidl/vts/EffectFactoryHelper.h
index 7100431..cc29f5e 100644
--- a/audio/aidl/vts/EffectFactoryHelper.h
+++ b/audio/aidl/vts/EffectFactoryHelper.h
@@ -23,6 +23,7 @@
#include <aidl/Vintf.h>
#include <android/binder_auto_utils.h>
+#include <system/audio_effects/aidl_effects_utils.h>
#include "AudioHalBinderServiceUtil.h"
#include "TestUtils.h"
@@ -74,6 +75,16 @@
return result;
}
+ static int getHalVersion(const std::shared_ptr<IFactory>& factory) {
+ int version = 0;
+ return (factory && factory->getInterfaceVersion(&version).isOk()) ? version : 0;
+ }
+
+ static bool isReopenSupported(const std::shared_ptr<IFactory>& factory) {
+ return EffectFactoryHelper::getHalVersion(factory) >=
+ aidl::android::hardware::audio::effect::kReopenSupportedVersion;
+ }
+
private:
std::shared_ptr<IFactory> mEffectFactory;
std::string mServiceName;