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

Commit 64c39327 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio V4: factorize analyzeStatus



This factorization had not been ported from the AOSP patch.
The code is functionally identical.

Test: compile
Bug: 69010523
Change-Id: Ied3a657d7c219b580eb32377789096f6b2f6dc19
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent cff68138
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -41,23 +41,7 @@ Device::~Device() {
}

Result Device::analyzeStatus(const char* funcName, int status) {
    if (status != 0) {
        ALOGW("Device %p %s: %s", mDevice, funcName, strerror(-status));
    }
    switch (status) {
        case 0:
            return Result::OK;
        case -EINVAL:
            return Result::INVALID_ARGUMENTS;
        case -ENODATA:
            return Result::INVALID_STATE;
        case -ENODEV:
            return Result::NOT_INITIALIZED;
        case -ENOSYS:
            return Result::NOT_SUPPORTED;
        default:
            return Result::INVALID_STATE;
    }
    return util::analyzeStatus("Device", funcName, status);
}

void Device::closeInputStream(audio_stream_in_t* stream) {