Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60f836dc authored by Wonsik Kim's avatar Wonsik Kim
Browse files

codecserviceregistrant: don't attempt to register AIDL service pre-V

Bug: 311105021
Test: build and install media.swcodec APEX
Change-Id: Idfb9c98d406c30d83b6f7be744b34423cf13db84
parent bfb05313
Loading
Loading
Loading
Loading
+19 −11
Original line number Diff line number Diff line
@@ -737,6 +737,12 @@ extern "C" void RegisterCodecServices() {
    using namespace ::android::hardware::media::c2;

    int platformVersion = android_get_device_api_level();
    // STOPSHIP: Remove code name checking once platform version bumps up to 35.
    std::string codeName =
        android::base::GetProperty("ro.build.version.codename", "");
    if (codeName == "VanillaIceCream") {
        platformVersion = __ANDROID_API_V__;
    }

    android::sp<V1_0::IComponentStore> hidlStore;
    std::shared_ptr<c2_aidl::IComponentStore> aidlStore;
@@ -797,6 +803,7 @@ extern "C" void RegisterCodecServices() {
        }
    }

    if (platformVersion >= __ANDROID_API_V__) {
        if (!aidlStore) {
            aidlStore = ::ndk::SharedRefBase::make<c2_aidl::utils::ComponentStore>(
                    std::make_shared<H2C2ComponentStore>(nullptr));
@@ -809,6 +816,7 @@ extern "C" void RegisterCodecServices() {
            LOG(ERROR) << "Cannot register software Codec2 AIDL service.";
            return;
        }
    }

    if (!hidlStore) {
        hidlStore = ::android::sp<V1_0::utils::ComponentStore>::make(