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

Commit 93e471f6 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Rename standby methods

ThreadBase::standby() returns the value of mStandby.

RecordThread::standby() "overrode" ThreadBase::standby(), but with a
different meaning and no return value.  This meant you couldn't
access the parent's class definition within RecordThread.

This could be confusing, so this CL renames RecordThread::standby()
to standbyIfNotAlreadyInStandby().

Change-Id: I9196ee12701dd2dccdfaed922af2d7b8e8774676
parent d21952fe
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -4445,7 +4445,7 @@ bool AudioFlinger::RecordThread::threadLoop()
            // make a stable copy of mActiveTrack
            // make a stable copy of mActiveTrack
            activeTrack = mActiveTrack;
            activeTrack = mActiveTrack;
            if (activeTrack == 0) {
            if (activeTrack == 0) {
                standby();
                standbyIfNotAlreadyInStandby();
                // exitPending() can't become true here
                // exitPending() can't become true here
                releaseWakeLock_l();
                releaseWakeLock_l();
                ALOGV("RecordThread: loop stopping");
                ALOGV("RecordThread: loop stopping");
@@ -4465,7 +4465,7 @@ bool AudioFlinger::RecordThread::threadLoop()
            activeTrackState = activeTrack->mState;
            activeTrackState = activeTrack->mState;
            switch (activeTrackState) {
            switch (activeTrackState) {
            case TrackBase::PAUSING:
            case TrackBase::PAUSING:
                standby();
                standbyIfNotAlreadyInStandby();
                mActiveTrack.clear();
                mActiveTrack.clear();
                mStartStopCond.broadcast();
                mStartStopCond.broadcast();
                doSleep = true;
                doSleep = true;
@@ -4642,7 +4642,7 @@ bool AudioFlinger::RecordThread::threadLoop()
        // effectChains doesn't need to be cleared, since it is cleared by destructor at scope end
        // effectChains doesn't need to be cleared, since it is cleared by destructor at scope end
    }
    }


    standby();
    standbyIfNotAlreadyInStandby();


    {
    {
        Mutex::Autolock _l(mLock);
        Mutex::Autolock _l(mLock);
@@ -4660,7 +4660,7 @@ bool AudioFlinger::RecordThread::threadLoop()
    return false;
    return false;
}
}


void AudioFlinger::RecordThread::standby()
void AudioFlinger::RecordThread::standbyIfNotAlreadyInStandby()
{
{
    if (!mStandby) {
    if (!mStandby) {
        inputStandBy();
        inputStandBy();
+1 −1
Original line number Original line Diff line number Diff line
@@ -931,7 +931,7 @@ private:
            void    clearSyncStartEvent();
            void    clearSyncStartEvent();


            // Enter standby if not already in standby, and set mStandby flag
            // Enter standby if not already in standby, and set mStandby flag
            void    standby();
            void    standbyIfNotAlreadyInStandby();


            // Call the HAL standby method unconditionally, and don't change mStandby flag
            // Call the HAL standby method unconditionally, and don't change mStandby flag
            void    inputStandBy();
            void    inputStandBy();