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

Commit 04d21065 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add a method to reset circular references in audio flinger service" into main

parents 2b36cfeb a6dadacc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -923,6 +923,11 @@ status_t AudioFlingerClientAdapter::setTracksInternalMute(
    return statusTFromBinderStatus(mDelegate->setTracksInternalMute(tracksInternalMuted));
}

status_t AudioFlingerClientAdapter::resetReferencesForTest() {
    RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mDelegate->resetReferencesForTest()));
    return OK;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// AudioFlingerServerAdapter
AudioFlingerServerAdapter::AudioFlingerServerAdapter(
@@ -1487,4 +1492,9 @@ Status AudioFlingerServerAdapter::setTracksInternalMute(
    return Status::fromStatusT(mDelegate->setTracksInternalMute(tracksInternalMute));
}

Status AudioFlingerServerAdapter::resetReferencesForTest() {
    RETURN_BINDER_IF_ERROR(mDelegate->resetReferencesForTest());
    return Status::ok();
}

} // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -299,6 +299,12 @@ interface IAudioFlingerService {
     */
    void setTracksInternalMute(in TrackInternalMuteInfo[] tracksInternalMute);

    /*
     * Reset Circular references in AudioFlinger service.
     * Test API
     */
     void resetReferencesForTest();

    // When adding a new method, please review and update
    // IAudioFlinger.h AudioFlingerServerAdapter::Delegate::TransactionCode
    // AudioFlinger.cpp AudioFlinger::onTransactWrapper()
+6 −0
Original line number Diff line number Diff line
@@ -392,6 +392,8 @@ public:

    virtual status_t setTracksInternalMute(
            const std::vector<media::TrackInternalMuteInfo>& tracksInternalMute) = 0;

    virtual status_t resetReferencesForTest() = 0;
};

/**
@@ -510,6 +512,7 @@ public:
                             struct audio_port_v7 *mixPort) const override;
    status_t setTracksInternalMute(
            const std::vector<media::TrackInternalMuteInfo>& tracksInternalMute) override;
    status_t resetReferencesForTest() override;

private:
    const sp<media::IAudioFlingerService> mDelegate;
@@ -613,6 +616,8 @@ public:
                    media::BnAudioFlingerService::TRANSACTION_getAudioPolicyConfig,
            GET_AUDIO_MIX_PORT = media::BnAudioFlingerService::TRANSACTION_getAudioMixPort,
            SET_TRACKS_INTERNAL_MUTE = media::BnAudioFlingerService::TRANSACTION_setTracksInternalMute,
            RESET_REFERENCES_FOR_TEST =
                    media::BnAudioFlingerService::TRANSACTION_resetReferencesForTest,
        };

    protected:
@@ -751,6 +756,7 @@ public:
                           media::AudioPortFw* _aidl_return) override;
    Status setTracksInternalMute(
            const std::vector<media::TrackInternalMuteInfo>& tracksInternalMute) override;
    Status resetReferencesForTest() override;
private:
    const sp<AudioFlingerServerAdapter::Delegate> mDelegate;
};
+11 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ BINDER_METHOD_ENTRY(supportsBluetoothVariableLatency) \
BINDER_METHOD_ENTRY(getSoundDoseInterface) \
BINDER_METHOD_ENTRY(getAudioPolicyConfig) \
BINDER_METHOD_ENTRY(getAudioMixPort) \
BINDER_METHOD_ENTRY(resetReferencesForTest) \

// singleton for Binder Method Statistics for IAudioFlinger
static auto& getIAudioFlingerStatistics() {
@@ -466,6 +467,8 @@ AudioFlinger::~AudioFlinger()
            sMediaLogService->unregisterWriter(iMemory);
        }
    }
    mMediaLogNotifier->requestExit();
    mPatchCommandThread->exit();
}

//static
@@ -4986,6 +4989,13 @@ status_t AudioFlinger::setTracksInternalMute(
    return NO_ERROR;
}

status_t AudioFlinger::resetReferencesForTest() {
    mDeviceEffectManager.clear();
    mPatchPanel.clear();
    mMelReporter->resetReferencesForTest();
    return NO_ERROR;
}

// ----------------------------------------------------------------------------

status_t AudioFlinger::onTransactWrapper(TransactionCode code,
@@ -5021,6 +5031,7 @@ status_t AudioFlinger::onTransactWrapper(TransactionCode code,
        case TransactionCode::GET_AUDIO_POLICY_CONFIG:
        case TransactionCode::GET_AUDIO_MIX_PORT:
        case TransactionCode::SET_TRACKS_INTERNAL_MUTE:
        case TransactionCode::RESET_REFERENCES_FOR_TEST:
            ALOGW("%s: transaction %d received from PID %d",
                  __func__, static_cast<int>(code), IPCThreadState::self()->getCallingPid());
            // return status only for non void methods
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ class AudioFlinger
public:
    static void instantiate() ANDROID_API;

    status_t resetReferencesForTest();

private:

    // ---- begin IAudioFlinger interface
Loading