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

Commit e1b5d4b9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make EffectConfig effect xml parsing cc_library" into main

parents 3191f3a9 6190a969
Loading
Loading
Loading
Loading
+47 −2
Original line number Diff line number Diff line
@@ -121,6 +121,52 @@ cc_library {
    ],
}

cc_library {
    name: "libeffectconfig",
    srcs: [
        "EffectConfig.cpp",
    ],
    defaults: [
        "latest_android_hardware_audio_effect_ndk_shared",
        "latest_android_media_audio_common_types_ndk_shared",
    ],
    shared_libs: [
        "libaudioutils",
        "libaudio_aidl_conversion_common_ndk",
        "libbase",
        "libbinder_ndk",
        "liblog",
        "libmedia_helper",
        "libtinyxml2",
        "libutils",
    ],
    header_libs: [
        "libaudio_system_headers",
        "libaudioaidl_headers",
    ],
    export_shared_lib_headers: [
        "libtinyxml2",
    ],
    export_include_dirs: [
        "include",
    ],
    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
        "-DBACKEND_NDK",
    ],
    vendor: true,
    host_supported: true,
    target: {
        android: {
            shared_libs: [
                "libapexsupport",
            ],
        },
    },
}

cc_binary {
    name: "android.hardware.audio.service-aidl.example",
    relative_install_path: "hw",
@@ -290,10 +336,9 @@ cc_binary {
    defaults: ["aidlaudioeffectservice_defaults"],
    shared_libs: [
        "libapexsupport",
        "libtinyxml2",
        "libeffectconfig",
    ],
    srcs: [
        "EffectConfig.cpp",
        "EffectFactory.cpp",
        "EffectMain.cpp",
    ],
+2 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ std::vector<std::reference_wrapper<const tinyxml2::XMLElement>> EffectConfig::ge
}

bool EffectConfig::resolveLibrary(const std::string& path, std::string* resolvedPath) {
#ifdef __ANDROID_APEX__
    if constexpr (__ANDROID_VENDOR_API__ >= 202404) {
        AApexInfo *apexInfo;
        if (AApexInfo_create(&apexInfo) == AAPEXINFO_OK) {
@@ -122,6 +123,7 @@ bool EffectConfig::resolveLibrary(const std::string& path, std::string* resolved
    } else {
        LOG(DEBUG) << __func__ << " libapexsupport is not supported";
    }
#endif

    // If audio effects libs are not in vendor apex, locate them in kEffectLibPath
    for (auto* libraryDirectory : kEffectLibPath) {