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

Commit 1d69c872 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix spurious error log at init

Move initialization of communication strategy in AudioPolicyManager::initialize()
before loading HW modules to avoid calling Engine::getDevicesForRoleAndStrategy()
with an unknown strategy.

Test: boot.
Change-Id: I156441aca09807ee4569eb81e3cb7b903a325184
parent 95f8fd2c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4657,6 +4657,9 @@ status_t AudioPolicyManager::initialize() {
        return status;
    }

    mCommunnicationStrategy = mEngine->getProductStrategyForAttributes(
        mEngine->getAttributesForStreamType(AUDIO_STREAM_VOICE_CALL));

    // after parsing the config, mOutputDevicesAll and mInputDevicesAll contain all known devices;
    // open all output streams needed to access attached devices
    onNewAudioModulesAvailableInt(nullptr /*newDevices*/);
@@ -4686,9 +4689,6 @@ status_t AudioPolicyManager::initialize() {
    // Silence ALOGV statements
    property_set("log.tag." LOG_TAG, "D");

    mCommunnicationStrategy = mEngine->getProductStrategyForAttributes(
            mEngine->getAttributesForStreamType(AUDIO_STREAM_VOICE_CALL));

    updateDevicesAndOutputs();
    return status;
}