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

Commit 10018da9 authored by Vlad Popa's avatar Vlad Popa
Browse files

Avoid calling virtual method in constructor

setPortMute is a virtual function and should not be called in the
constructor. Use a simplified logic since at track constructions there
are not active patch tracks.

Flag: EXEMPT bugfix
Test: manual
Bug: 28835785
Change-Id: I14411735ee4a5e61be78018ca1bb2b3d6e60f634
parent ee9b3db9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -863,14 +863,17 @@ Track::Track(
    }

    populateUsageAndContentTypeFromStreamType();
    setPortMute(muted);

    mute_state_t newMuteState = mMuteState.load();
    newMuteState.muteFromPortVolume = muted;

    // Audio patch and call assistant volume are always max
    if (mAttr.usage == AUDIO_USAGE_CALL_ASSISTANT
            || mAttr.usage == AUDIO_USAGE_VIRTUAL_SOURCE) {
        mVolume = 1.0f;
        setPortMute(false);
        newMuteState.muteFromPortVolume = false;
    }
    mMuteState.store(newMuteState);

    mServerLatencySupported = checkServerLatencySupported(format, flags);
#ifdef TEE_SINK