mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:09:42 +00:00
Merge "Effect Aidl: skipping reopen test for unsupported audio hal" into main
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <aidl/Vintf.h>
|
#include <aidl/Vintf.h>
|
||||||
#include <android/binder_auto_utils.h>
|
#include <android/binder_auto_utils.h>
|
||||||
|
#include <system/audio_effects/aidl_effects_utils.h>
|
||||||
|
|
||||||
#include "AudioHalBinderServiceUtil.h"
|
#include "AudioHalBinderServiceUtil.h"
|
||||||
#include "TestUtils.h"
|
#include "TestUtils.h"
|
||||||
@@ -74,6 +75,16 @@ class EffectFactoryHelper {
|
|||||||
return result;
|
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:
|
private:
|
||||||
std::shared_ptr<IFactory> mEffectFactory;
|
std::shared_ptr<IFactory> mEffectFactory;
|
||||||
std::string mServiceName;
|
std::string mServiceName;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ using aidl::android::hardware::audio::effect::Descriptor;
|
|||||||
using aidl::android::hardware::audio::effect::Flags;
|
using aidl::android::hardware::audio::effect::Flags;
|
||||||
using aidl::android::hardware::audio::effect::IEffect;
|
using aidl::android::hardware::audio::effect::IEffect;
|
||||||
using aidl::android::hardware::audio::effect::IFactory;
|
using aidl::android::hardware::audio::effect::IFactory;
|
||||||
|
using aidl::android::hardware::audio::effect::kReopenSupportedVersion;
|
||||||
using aidl::android::hardware::audio::effect::Parameter;
|
using aidl::android::hardware::audio::effect::Parameter;
|
||||||
using aidl::android::hardware::audio::effect::State;
|
using aidl::android::hardware::audio::effect::State;
|
||||||
using aidl::android::media::audio::common::AudioDeviceDescription;
|
using aidl::android::media::audio::common::AudioDeviceDescription;
|
||||||
@@ -613,6 +614,10 @@ TEST_P(AudioEffectTest, SetAndGetParameterVolume) {
|
|||||||
* verify reopen sequence.
|
* verify reopen sequence.
|
||||||
*/
|
*/
|
||||||
TEST_P(AudioEffectDataPathTest, SetCommonParameterAndReopen) {
|
TEST_P(AudioEffectDataPathTest, SetCommonParameterAndReopen) {
|
||||||
|
if (!EffectFactoryHelper::isReopenSupported(mFactory)) {
|
||||||
|
GTEST_SKIP() << "Skipping test as effect does not support reopen";
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -732,6 +737,10 @@ TEST_P(AudioEffectDataPathTest, ConsumeDataAfterRestart) {
|
|||||||
// Send data to effects and expect it to be consumed after effect reopen (IO AudioConfig change).
|
// Send data to effects and expect it to be consumed after effect reopen (IO AudioConfig change).
|
||||||
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
TEST_P(AudioEffectDataPathTest, ConsumeDataAfterReopen) {
|
TEST_P(AudioEffectDataPathTest, ConsumeDataAfterReopen) {
|
||||||
|
if (!EffectFactoryHelper::isReopenSupported(mFactory)) {
|
||||||
|
GTEST_SKIP() << "Skipping test as effect does not support reopen";
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
|
|||||||
Reference in New Issue
Block a user