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

Commit 9ae44f31 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: remove excessive warning

Do not display a logcat warning when removing
a device role for a strategy or capture preset and none has
been set before: This is not a problem.

Test: make
Change-Id: If82f6b2ca64d52646b466c185121cc4eec53fe25
parent d37141ea
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -3916,7 +3916,8 @@ status_t AudioPolicyManager::clearDevicesRoleForStrategy(product_strategy_t stra

    status_t status = mEngine->clearDevicesRoleForStrategy(strategy, role);
    if (status != NO_ERROR) {
        ALOGV("Engine could not remove device role for strategy %d status %d",
        ALOGW_IF(status != NAME_NOT_FOUND,
                "Engine could not remove device role for strategy %d status %d",
                strategy, status);
        return status;
    }
@@ -3988,10 +3989,11 @@ status_t AudioPolicyManager::removeDevicesRoleForCapturePreset(

    status_t status = mEngine->removeDevicesRoleForCapturePreset(
            audioSource, role, devices);
    ALOGW_IF(status != NO_ERROR,
    ALOGW_IF(status != NO_ERROR && status != NAME_NOT_FOUND,
            "Engine could not remove devices role (%d) for capture preset %d", role, audioSource);

    if (status == NO_ERROR) {
        updateInputRouting();
    }
    return status;
}

@@ -4000,10 +4002,11 @@ status_t AudioPolicyManager::clearDevicesRoleForCapturePreset(audio_source_t aud
    ALOGV("%s() audioSource=%d role=%d", __func__, audioSource, role);

    status_t status = mEngine->clearDevicesRoleForCapturePreset(audioSource, role);
    ALOGW_IF(status != NO_ERROR,
    ALOGW_IF(status != NO_ERROR && status != NAME_NOT_FOUND,
            "Engine could not clear devices role (%d) for capture preset %d", role, audioSource);

    if (status == NO_ERROR) {
        updateInputRouting();
    }
    return status;
}