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

Commit df83624e authored by François Gaffie's avatar François Gaffie
Browse files

audiopolicy: capengine: aidl hybrid mode enable



This CL adds the support of hybrid AIDL Audio HAL
and CapEngine relying on legacy vendor XML file.

Bug: 379596346
Test: m

Change-Id: Ic876bf1728b80e6d9e330fc9c0d24858ff8389f8
Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@ampere.cars>
parent 19a90426
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ public:

    // The source used to indicate the configuration from the AIDL HAL.
    static const constexpr char* const kAidlConfigSource = "AIDL HAL";
    // The source used to indicate the configuration from the AIDL HAL but engine still use XML.
    static const constexpr char* const kHybridAidlConfigSource = "AIDL HAL Hybrid CAP";
    // The source used to indicate the default fallback configuration.
    static const constexpr char* const kDefaultConfigSource = "AudioPolicyConfig::setDefault";
    // The suffix of the "engine default" implementation shared library name.
+3 −0
Original line number Diff line number Diff line
@@ -272,6 +272,9 @@ status_t AudioPolicyConfig::loadFromAidl(const media::AudioPolicyConfig& aidl) {
    mSource = kAidlConfigSource;
    if (aidl.engineConfig.capSpecificConfig.has_value()) {
        setEngineLibraryNameSuffix(kCapEngineLibraryNameSuffix);
        if (!aidl.engineConfig.capSpecificConfig.value().domains.has_value()) {
            mSource = kHybridAidlConfigSource;
        }
    }
    // No need to augmentData() as AIDL HAL must provide correct mic addresses.
    return NO_ERROR;
+16 −7
Original line number Diff line number Diff line
@@ -27,7 +27,10 @@ cc_library_shared {
        "-Wall",
        "-Werror",
        "-Wextra",
    ],
    ] + select(release_flag("RELEASE_HARDWARE_AUDIO_USE_CAP_AIDL"), {
        true: [],
        default: ["-DENABLE_CAP_AIDL_HYBRID_MODE"],
    }),
    local_include_dirs: ["include"],
    header_libs: [
        "libaudiopolicycommon",
@@ -59,10 +62,16 @@ cc_library_shared {
        "latest_android_media_audio_common_types_cpp_shared",
    ],
    required: [
    ] + select(release_flag("RELEASE_HARDWARE_AUDIO_USE_CAP_AIDL"), {
        true: [
            "CapClass.xml",
            "CapProductStrategies.xml",
            "CapSubsystem-CommonTypes.xml",
            "CapSubsystem.xml",
            "ParameterFrameworkConfigurationCap.xml",
        ],
        default: [
            // empty, provisionned by the vendor
        ],
    }),
}
+5 −0
Original line number Diff line number Diff line
@@ -75,8 +75,13 @@ status_t Engine::loadFromHalConfigWithFallback(

    auto capResult = capEngineConfig::convert(aidlConfig);
    if (capResult.parsedConfig == nullptr) {
#ifdef ENABLE_CAP_AIDL_HYBRID_MODE
        ALOGE("%s CapEngine Config invalid, falling back on vendor XML for engine", __func__);
        return loadFromXmlConfigWithFallback(engineConfig::DEFAULT_PATH);
#else
        ALOGE("%s CapEngine Config invalid", __func__);
        return BAD_VALUE;
#endif
    }
    status_t ret = loadWithFallback(aidlConfig);
    if (ret != NO_ERROR) {
+4 −1
Original line number Diff line number Diff line
@@ -16,7 +16,10 @@ cc_library {
        "-Wall",
        "-Werror",
        "-Wextra",
    ],
    ] + select(release_flag("RELEASE_HARDWARE_AUDIO_USE_CAP_AIDL"), {
        true: [],
        default: ["-DENABLE_CAP_AIDL_HYBRID_MODE"],
    }),
    header_libs: [
        "libaudiofoundation_headers",
        "libaudiopolicycapengine_config_headers",
Loading