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

Commit 0f8f3e47 authored by Wonsik Kim's avatar Wonsik Kim Committed by Gerrit Code Review
Browse files

Merge "Revert "Add media.c2 AIDL service to media.swcodec"" into main

parents 42652123 2ecfbeb6
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ package {
// use libcodec2-aidl-client-defaults instead
cc_library {
    name: "libcodec2_aidl_client",
    min_sdk_version: "31",

    srcs: [
        "BufferTypes.cpp",
@@ -35,6 +36,7 @@ cc_library {
    ],

    static_libs: [
        "libPlatformProperties",
        "libaidlcommonsupport",
    ],

@@ -53,7 +55,7 @@ cc_library {
// use libcodec2-aidl-defaults instead
cc_library {
    name: "libcodec2_aidl",
    min_sdk_version: "30",
    min_sdk_version: "31",
    vendor_available: true,
    apex_available: [
        "//apex_available:platform",
@@ -96,6 +98,7 @@ cc_library {
    ],

    static_libs: [
        "libPlatformProperties",
        "libaidlcommonsupport",
    ],

@@ -131,7 +134,7 @@ cc_library {
// public dependency for Codec 2.0 HAL service implementations
cc_defaults {
    name: "libcodec2-aidl-defaults",
    min_sdk_version: "30",
    min_sdk_version: "31",
    defaults: ["libcodec2-impl-defaults"],

    shared_libs: [
@@ -144,6 +147,7 @@ cc_defaults {
// public dependency for Codec 2.0 HAL client
cc_defaults {
    name: "libcodec2-aidl-client-defaults",
    min_sdk_version: "31",
    defaults: ["libcodec2-impl-defaults"],

    shared_libs: [
+1 −15
Original line number Diff line number Diff line
@@ -19,9 +19,7 @@
#include <android-base/logging.h>

#include <android/binder_manager.h>
// NOTE: due to dependency from mainline modules cannot use libsysprop
// #include <android/sysprop/MediaProperties.sysprop.h>
#include <android-base/properties.h>
#include <android/sysprop/MediaProperties.sysprop.h>
#include <codec2/aidl/ParamTypes.h>
#include <codec2/common/ParamTypes.h>

@@ -169,8 +167,6 @@ bool IsSelected() {
        // Cannot select AIDL if not enabled
        return false;
    }
#if 0
    // NOTE: due to dependency from mainline modules cannot use libsysprop
    using ::android::sysprop::MediaProperties::codec2_hal_selection;
    using ::android::sysprop::MediaProperties::codec2_hal_selection_values;
    constexpr codec2_hal_selection_values AIDL = codec2_hal_selection_values::AIDL;
@@ -184,16 +180,6 @@ bool IsSelected() {
    default:
        LOG(FATAL) << "Unexpected codec2 HAL selection value: " << (int)selection;
    }
#else
    std::string selection = ::android::base::GetProperty("media.c2.hal.selection", "hidl");
    if (selection == "aidl") {
        return true;
    } else if (selection == "hidl") {
        return false;
    } else {
        LOG(FATAL) << "Unexpected codec2 HAL selection value: " << selection;
    }
#endif

    return false;
}
+20 −29
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@
#include <aidl/android/hardware/media/c2/StructDescriptor.h>

#include <aidlcommonsupport/NativeHandle.h>
#include <android/api-level.h>
#include <android/binder_auto_utils.h>
#include <android/binder_ibinder.h>
#include <android/binder_manager.h>
@@ -1440,16 +1439,12 @@ std::vector<std::string> Codec2Client::CacheServiceNames() {
    std::vector<std::string> names;

    if (c2_aidl::utils::IsSelected()) {
        if (__builtin_available(android __ANDROID_API_S__, *)) {
        // Get AIDL service names
        AServiceManager_forEachDeclaredInstance(
                AidlBase::descriptor, &names, [](const char *name, void *context) {
                    std::vector<std::string> *names = (std::vector<std::string> *)context;
                    names->emplace_back(name);
                });
        } else {
            LOG(FATAL) << "C2 AIDL cannot be selected on Android version older than 35";
        }
    } else {
        // Get HIDL service names
        using ::android::hardware::media::c2::V1_0::IComponentStore;
@@ -1551,7 +1546,6 @@ std::shared_ptr<Codec2Client> Codec2Client::_CreateFromIndex(size_t index) {
    LOG(VERBOSE) << "Creating a Codec2 client to service \"" << name << "\"";

    if (c2_aidl::utils::IsSelected()) {
        if (__builtin_available(android __ANDROID_API_S__, *)) {
        std::string instanceName =
            ::android::base::StringPrintf("%s/%s", AidlBase::descriptor, name.c_str());
        if (AServiceManager_isDeclared(instanceName.c_str())) {
@@ -1568,9 +1562,6 @@ std::shared_ptr<Codec2Client> Codec2Client::_CreateFromIndex(size_t index) {
        } else {
            LOG(ERROR) << "Codec2 AIDL service \"" << name << "\" is not declared";
        }
        } else {
            LOG(FATAL) << "C2 AIDL cannot be selected on Android version older than 35";
        }
    } else {
        std::string instanceName = "android.hardware.media.c2/" + name;
        sp<HidlBase> baseStore = HidlBase::getService(name);
+0 −5
Original line number Diff line number Diff line
@@ -8,9 +8,4 @@
            <instance>software</instance>
        </interface>
    </hal>
    <hal format="aidl">
        <name>android.hardware.media.c2</name>
        <version>1</version>
        <fqname>IComponentStore/software</fqname>
    </hal>
</manifest>
+0 −1
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ cc_library {
    ],

    defaults: [
        "libcodec2-aidl-defaults",
        "libcodec2-hidl-defaults",
        "libcodec2-runtime-libs",
    ],
Loading