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

Commit bccb3ecc authored by Shunkai Yao's avatar Shunkai Yao Committed by Automerger Merge Worker
Browse files

Merge "Update DeviceEffectManager with AudioHalVersionInfo" am: 334d96ee am:...

Merge "Update DeviceEffectManager with AudioHalVersionInfo" am: 334d96ee am: 949540c6 am: a1c7d180

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2336689



Change-Id: I85cd794d5a5ccc9000308a5285f05a21dbe7e9d9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 55fd8fa3 a1c7d180
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@

namespace android {

using media::AudioHalVersion;
using detail::AudioHalVersionInfo;
using media::IEffectClient;

void AudioFlinger::DeviceEffectManager::onCreateAudioPatch(audio_patch_handle_t handle,
@@ -116,14 +116,12 @@ status_t AudioFlinger::DeviceEffectManager::checkEffectCompatibility(
        return BAD_VALUE;
    }

    static AudioHalVersion sMinDeviceEffectHalVersion;
    sMinDeviceEffectHalVersion.type = AudioHalVersion::Type::HIDL;
    sMinDeviceEffectHalVersion.major = 6;
    sMinDeviceEffectHalVersion.minor = 0;
    AudioHalVersion halVersion = effectsFactory->getHalVersion();
    static AudioHalVersionInfo sMinDeviceEffectHalVersion =
            AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 6, 0);
    AudioHalVersionInfo halVersion = effectsFactory->getHalVersion();

    // We can trust AIDL generated AudioHalVersion comparison operator (based on std::tie) as long
    // as the type, major and minor sequence doesn't change in the definition.
    // We can trust AIDL generated AudioHalVersionInfo comparison operator (based on std::tie) as
    // long as the type, major and minor sequence doesn't change in the definition.
    if (((desc->flags & EFFECT_FLAG_TYPE_MASK) != EFFECT_FLAG_TYPE_PRE_PROC
            && (desc->flags & EFFECT_FLAG_TYPE_MASK) != EFFECT_FLAG_TYPE_POST_PROC)
            || halVersion < sMinDeviceEffectHalVersion) {