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

Commit 90059b0d authored by Neha Jain's avatar Neha Jain Committed by Android Build Coastguard Worker
Browse files

Revert "APM: apply volumes when abs volume stream changes"

This reverts commit fb0af7ca.

Reason for revert: b/379009970
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7af15130467877bdcbafea5e51dba409754d3610)
Merged-In: I0ef4f7029be6d2c9914f89b43536df726bd2553c
Change-Id: I0ef4f7029be6d2c9914f89b43536df726bd2553c
parent d090982e
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -3573,8 +3573,12 @@ status_t AudioPolicyManager::setDeviceAbsoluteVolumeEnabled(audio_devices_t devi
    ALOGI("%s: deviceType 0x%X, enabled %d, streamToDriveAbs %d", __func__, deviceType, enabled,
          streamToDriveAbs);

    if (!enabled) {
        mAbsoluteVolumeDrivingStreams.erase(deviceType);
        return NO_ERROR;
    }

    audio_attributes_t attributesToDriveAbs = mEngine->getAttributesForStreamType(streamToDriveAbs);
    if (enabled) {
    if (attributesToDriveAbs == AUDIO_ATTRIBUTES_INITIALIZER) {
        ALOGW("%s: no attributes for stream %s, bailing out", __func__,
              toString(streamToDriveAbs).c_str());
@@ -3582,17 +3586,6 @@ status_t AudioPolicyManager::setDeviceAbsoluteVolumeEnabled(audio_devices_t devi
    }

    mAbsoluteVolumeDrivingStreams[deviceType] = attributesToDriveAbs;
    } else {
        mAbsoluteVolumeDrivingStreams.erase(deviceType);
    }

    // apply the stream volumes regarding the new absolute mode to all the outputs
    for (size_t i = 0; i < mOutputs.size(); i++) {
        sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
        ALOGV("%s: apply stream volumes for portId %d", __func__, desc->getId());
        applyStreamVolumes(desc, {deviceType}, static_cast<int>(desc->latency()) * 2);
    }

    return NO_ERROR;
}