mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "AIDL effect: Effect factory add EffectProxy information in proxy" am: ff16dd1f7b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2459230 Change-Id: I62b92179d50ac6a2f2cbac868b81d69294425aee Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -75,6 +75,8 @@ ndk::ScopedAStatus Factory::queryEffects(const std::optional<AudioUuid>& in_type
|
|||||||
RETURN_IF(!libInterface || !libInterface->queryEffectFunc, EX_NULL_POINTER,
|
RETURN_IF(!libInterface || !libInterface->queryEffectFunc, EX_NULL_POINTER,
|
||||||
"dlNullQueryEffectFunc");
|
"dlNullQueryEffectFunc");
|
||||||
RETURN_IF_BINDER_EXCEPTION(libInterface->queryEffectFunc(&id.uuid, &desc));
|
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));
|
_aidl_return->emplace_back(std::move(desc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,10 @@ TEST_P(AudioEffectTest, GetDescritorBeforeOpen) {
|
|||||||
Descriptor desc;
|
Descriptor desc;
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
ASSERT_NO_FATAL_FAILURE(getDescriptor(mEffect, desc));
|
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
|
// Effect implementation Must fill in implementor and name
|
||||||
EXPECT_NE("", desc.common.name);
|
EXPECT_NE("", desc.common.name);
|
||||||
EXPECT_NE("", desc.common.implementor);
|
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(create(mFactory, mEffect, mDescriptor));
|
||||||
ASSERT_NO_FATAL_FAILURE(getDescriptor(mEffect, desc));
|
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));
|
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user