audio: Update default effect HAL wrapper to support V7
During this conversion, the functionality of the V7 wrapper
hasn't been tested yet. This will be done in a separate CL
that will also include required updates to the VTS tests.
Since the changes were made to the code shared with pre-V7
versions, verified that V6 HAL didn't regress.
Bug: 142480271
Test: atest VtsHalAudioEffectV6_0TargetTest
Test: m VtsHalAudioEffectV7_0TargetTest
Test: m android.hardware.audio@7.0-service.example
Change-Id: I72389c8d564596bef22b47dfdcb2e77d636ef0a3
Merged-In: I72389c8d564596bef22b47dfdcb2e77d636ef0a3
diff --git a/audio/effect/all-versions/default/EffectsFactory.cpp b/audio/effect/all-versions/default/EffectsFactory.cpp
index b265d3d..1ea990b 100644
--- a/audio/effect/all-versions/default/EffectsFactory.cpp
+++ b/audio/effect/all-versions/default/EffectsFactory.cpp
@@ -82,7 +82,9 @@
} else if (memcmp(halUuid, SL_IID_VISUALIZATION, sizeof(effect_uuid_t)) == 0) {
return new VisualizerEffect(handle);
}
- return new Effect(handle);
+ const bool isInput =
+ (halDescriptor.flags & EFFECT_FLAG_TYPE_PRE_PROC) == EFFECT_FLAG_TYPE_PRE_PROC;
+ return new Effect(isInput, handle);
}
// Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.