Set minsdk for AIDL libs to 31
media.swcodec needs to link against the AIDL libs, so set the minsdk
to 31 which is required for the APEX.
Test: m
Change-Id: I6ed3f13a324b9dafdc5121d103ef1c1bfd9d286c
diff --git a/media/codec2/hal/aidl/Component.cpp b/media/codec2/hal/aidl/Component.cpp
index fa18c3e..9c21a5b 100644
--- a/media/codec2/hal/aidl/Component.cpp
+++ b/media/codec2/hal/aidl/Component.cpp
@@ -301,7 +301,7 @@
switch (allocator.getTag()) {
case ALLOCATOR_ID:
#ifdef __ANDROID_APEX__
- status = CreateCodec2BlockPool(
+ status = ::android::CreateCodec2BlockPool(
static_cast<::android::C2PlatformAllocatorStore::id_t>(
allocator.get<ALLOCATOR_ID>()),
mComponent,
@@ -405,18 +405,22 @@
}
void Component::initListener(const std::shared_ptr<Component>& self) {
- std::shared_ptr<C2Component::Listener> c2listener =
- std::make_shared<Listener>(self);
- c2_status_t res = mComponent->setListener_vb(c2listener, C2_DONT_BLOCK);
- if (res != C2_OK) {
- mInit = res;
- }
+ if (__builtin_available(android __ANDROID_API_T__, *)) {
+ std::shared_ptr<C2Component::Listener> c2listener =
+ std::make_shared<Listener>(self);
+ c2_status_t res = mComponent->setListener_vb(c2listener, C2_DONT_BLOCK);
+ if (res != C2_OK) {
+ mInit = res;
+ }
- mDeathRecipient = ::ndk::ScopedAIBinder_DeathRecipient(
- AIBinder_DeathRecipient_new(OnBinderDied));
- mDeathContext = new DeathContext{weak_from_this()};
- AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), OnBinderUnlinked);
- AIBinder_linkToDeath(mListener->asBinder().get(), mDeathRecipient.get(), mDeathContext);
+ mDeathRecipient = ::ndk::ScopedAIBinder_DeathRecipient(
+ AIBinder_DeathRecipient_new(OnBinderDied));
+ mDeathContext = new DeathContext{weak_from_this()};
+ AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), OnBinderUnlinked);
+ AIBinder_linkToDeath(mListener->asBinder().get(), mDeathRecipient.get(), mDeathContext);
+ } else {
+ mInit = C2_NO_INIT;
+ }
}
// static