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

Commit f6224dec authored by Zach Jang's avatar Zach Jang Committed by android-build-merger
Browse files

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

am: 681bc45d

* commit '681bc45d':
  Revert "Revert "audio policy: bind setMode() and setPhoneState() operations""
parents 8c5b71ce 681bc45d
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;