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

Commit 4f16d200 authored by Christian Bejram's avatar Christian Bejram Committed by Android (Google) Code Review
Browse files

Merge "audio policy: bind setMode() and setPhoneState() operations" into mnc-dev

parents 81fe612e 9ddf1c76
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -76,10 +76,14 @@ status_t AudioPolicyService::setPhoneState(audio_mode_t state)

    ALOGV("setPhoneState()");

    // acquire lock before calling setMode() so that setMode() + setPhoneState() are an atomic
    // operation from policy manager standpoint (no other operation (e.g track start or stop)
    // can be interleaved).
    Mutex::Autolock _l(mLock);

    // TODO: check if it is more appropriate to do it in platform specific policy manager
    AudioSystem::setMode(state);

    Mutex::Autolock _l(mLock);
    mAudioPolicyManager->setPhoneState(state);
    mPhoneState = state;
    return NO_ERROR;