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

Commit 591d9a36 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "mAudioRecord is always non-0 if set() is successful"

parents 7c1b8941 089e8720
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -102,10 +102,8 @@ AudioRecord::~AudioRecord()
            mAudioRecordThread->requestExitAndWait();
            mAudioRecordThread.clear();
        }
        if (mAudioRecord != 0) {
        mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this);
        mAudioRecord.clear();
        }
        IPCThreadState::self()->flushCommands();
        AudioSystem::releaseAudioSessionId(mSessionId, -1);
    }
@@ -162,6 +160,7 @@ status_t AudioRecord::set(

    AutoMutex lock(mLock);

    // invariant that mAudioRecord != 0 is true only after set() returns successfully
    if (mAudioRecord != 0) {
        ALOGE("Track already in use");
        return INVALID_OPERATION;
@@ -501,6 +500,7 @@ status_t AudioRecord::openRecord_l(size_t epoch)
        ALOGE("Could not get control block pointer");
        return NO_INIT;
    }
    // invariant that mAudioRecord != 0 is true only after set() returns successfully
    if (mAudioRecord != 0) {
        mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this);
        mDeathNotifier.clear();