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

Commit 3b759c68 authored by jiabin's avatar jiabin
Browse files

AAudio: log warning when calling stop but the thread is not started.

The AAudioThread can be just created but not started. In that case, it
is not that serious when calling stop but the thread is not started.

Bug: 283891335
Test: make
Change-Id: I88d2c06c7161ad97b3a9eae1fe3cc0b71845fdef
parent 2d174709
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -75,7 +75,9 @@ aaudio_result_t AAudioThread::start(Runnable *runnable) {

aaudio_result_t AAudioThread::stop() {
    if (!mHasThread) {
        ALOGE("stop() but no thread running");
        // There can be cases that the thread is just created but not started.
        // Logging as warning to attract attention but not too serious.
        ALOGW("stop() but no thread running");
        return AAUDIO_ERROR_INVALID_STATE;
    }