Merge "AIDL effect: Effect factory add EffectProxy information in proxy" am: ff16dd1f7b am: a3e89e9f4e am: 7b7a074c16

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

Change-Id: I5fc72bfd25e0d8b13c8f2c1b4c5f9f91dacc7cf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shunkai Yao
2023-03-25 01:46:56 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 2 deletions

View File

@@ -75,6 +75,8 @@ ndk::ScopedAStatus Factory::queryEffects(const std::optional<AudioUuid>& in_type
RETURN_IF(!libInterface || !libInterface->queryEffectFunc, EX_NULL_POINTER,
"dlNullQueryEffectFunc");
RETURN_IF_BINDER_EXCEPTION(libInterface->queryEffectFunc(&id.uuid, &desc));
// update proxy UUID with information from config xml
desc.common.id.proxy = id.proxy;
_aidl_return->emplace_back(std::move(desc));
}
}

View File

@@ -139,7 +139,10 @@ TEST_P(AudioEffectTest, GetDescritorBeforeOpen) {
Descriptor desc;
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(getDescriptor(mEffect, desc));
EXPECT_EQ(mDescriptor.common, desc.common);
EXPECT_EQ(mDescriptor.common.id.type, desc.common.id.type);
EXPECT_EQ(mDescriptor.common.id.uuid, desc.common.id.uuid);
EXPECT_EQ(mDescriptor.common.name, desc.common.name);
EXPECT_EQ(mDescriptor.common.implementor, desc.common.implementor);
// Effect implementation Must fill in implementor and name
EXPECT_NE("", desc.common.name);
EXPECT_NE("", desc.common.implementor);
@@ -176,7 +179,11 @@ TEST_P(AudioEffectTest, DescriptorExistAndUnique) {
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(getDescriptor(mEffect, desc));
EXPECT_EQ(1ul, idSet.count(desc.common.id));
int uuidCount = std::count_if(idSet.begin(), idSet.end(), [&](const auto& id) {
return id.uuid == desc.common.id.uuid && id.type == desc.common.id.type;
});
EXPECT_EQ(1, uuidCount);
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
}