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

Commit 82f82ee5 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11479893 from 2f10c36e to 24Q2-release

Change-Id: I1fe027d42096995a051c31b80e49052c6c068c46
parents 8bcff7de 2f10c36e
Loading
Loading
Loading
Loading
+29 −15
Original line number Diff line number Diff line
@@ -1699,12 +1699,24 @@ audio_io_handle_t AudioTrack::getOutput() const
}

status_t AudioTrack::setOutputDevice(audio_port_handle_t deviceId) {
    status_t result = NO_ERROR;
    AutoMutex lock(mLock);
    ALOGV("%s(%d): deviceId=%d mSelectedDeviceId=%d mRoutedDeviceId %d",
            __func__, mPortId, deviceId, mSelectedDeviceId, mRoutedDeviceId);
    ALOGV("%s(%d): deviceId=%d mSelectedDeviceId=%d",
            __func__, mPortId, deviceId, mSelectedDeviceId);
    if (mSelectedDeviceId != deviceId) {
        mSelectedDeviceId = deviceId;
        if (mStatus == NO_ERROR) {
            if (isOffloadedOrDirect_l()) {
                if (mState == STATE_STOPPED || mState == STATE_FLUSHED) {
                    ALOGD("%s(%d): creating a new AudioTrack", __func__, mPortId);
                    result = restoreTrack_l("setOutputDevice", true /* forceRestore */);
                } else {
                    ALOGW("%s(%d). Offloaded or Direct track is not STOPPED or FLUSHED. "
                          "State: %s.",
                            __func__, mPortId, stateToString(mState));
                    result = INVALID_OPERATION;
                }
            } else {
                // allow track invalidation when track is not playing to propagate
                // the updated mSelectedDeviceId
                if (isPlaying_l()) {
@@ -1721,7 +1733,8 @@ status_t AudioTrack::setOutputDevice(audio_port_handle_t deviceId) {
                }
            }
        }
    return NO_ERROR;
    }
    return result;
}

audio_port_handle_t AudioTrack::getOutputDevice() {
@@ -2836,7 +2849,7 @@ nsecs_t AudioTrack::processAudioBuffer()
    return 0;
}

status_t AudioTrack::restoreTrack_l(const char *from)
status_t AudioTrack::restoreTrack_l(const char *from, bool forceRestore)
{
    status_t result = NO_ERROR;  // logged: make sure to set this before returning.
    const int64_t beginNs = systemTime();
@@ -2857,7 +2870,8 @@ status_t AudioTrack::restoreTrack_l(const char *from)
    // output parameters and new IAudioFlinger in createTrack_l()
    AudioSystem::clearAudioConfigCache();

    if (isOffloadedOrDirect_l() || mDoNotReconnect) {
    if (!forceRestore &&
        (isOffloadedOrDirect_l() || mDoNotReconnect)) {
        // FIXME re-creation of offloaded and direct tracks is not yet implemented;
        // Disabled since (1) timestamp correction is not implemented for non-PCM and
        // (2) We pre-empt existing direct tracks on resource constraint, so these tracks
+1 −1
Original line number Diff line number Diff line
@@ -1220,7 +1220,7 @@ public:
            void setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount);

            // FIXME enum is faster than strcmp() for parameter 'from'
            status_t restoreTrack_l(const char *from);
            status_t restoreTrack_l(const char *from, bool forceRestore = false);

            uint32_t    getUnderrunCount_l() const;

+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
#include "effectsAidlConversion/AidlConversionVisualizer.h"

using ::aidl::android::aidl_utils::statusTFromBinderStatus;
using ::aidl::android::hardware::audio::effect::CommandId;
using ::aidl::android::hardware::audio::effect::Descriptor;
using ::aidl::android::hardware::audio::effect::IEffect;
using ::aidl::android::hardware::audio::effect::IFactory;
@@ -285,6 +286,7 @@ status_t EffectHalAidl::getDescriptor(effect_descriptor_t* pDescriptor) {

status_t EffectHalAidl::close() {
    TIME_CHECK();
    mEffect->command(CommandId::STOP);
    return statusTFromBinderStatus(mEffect->close());
}

+5 −0
Original line number Diff line number Diff line
@@ -1640,6 +1640,11 @@ off64_t MPEG4Writer::addSample_l(
    ALOGV("buffer->range_length:%lld", (long long)buffer->range_length());
    if (buffer->meta_data().findInt64(kKeySampleFileOffset, &offset)) {
        ALOGV("offset:%lld, old_offset:%lld", (long long)offset, (long long)old_offset);
        if (mMaxOffsetAppend > offset) {
            // This has already been appended, skip updating mOffset value.
            *bytesWritten = buffer->range_length();
            return offset;
        }
        if (old_offset == offset) {
            mOffset += buffer->range_length();
        } else {
+6 −4
Original line number Diff line number Diff line
@@ -231,10 +231,12 @@ audio_port_handle_t SoundDoseManager::getIdForAudioDevice(const AudioDevice& aud
        ALOGI("%s: could not find port id for device %s", __func__, adt.toString().c_str());
        return AUDIO_PORT_HANDLE_NONE;
    }

    if (audio_is_ble_out_device(type) || audio_is_a2dp_device(type)) {
        const auto btDeviceIt = mBluetoothDevicesWithCsd.find(std::make_pair(address, type));
    if (btDeviceIt != mBluetoothDevicesWithCsd.end()) {
        if (!btDeviceIt->second) {
            ALOGI("%s: bt device %s does not support sound dose", __func__, adt.toString().c_str());
        if (btDeviceIt == mBluetoothDevicesWithCsd.end() || !btDeviceIt->second) {
            ALOGI("%s: bt device %s does not support sound dose", __func__,
                  adt.toString().c_str());
            return AUDIO_PORT_HANDLE_NONE;
        }
    }
Loading