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

Commit 02d69c15 authored by Phil Burk's avatar Phil Burk Committed by Android (Google) Code Review
Browse files

Merge "audioflinger: add setCallerName() to AudioTrack" into rvc-dev

parents d727f80a d3813f35
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ protected:
        return mFramesRead.increment(frames);
    }

    // This is used for exact matching by MediaMetrics. So do not change it.
    static constexpr char     kCallerName[] = "aaudio";

    MonotonicCounter           mFramesWritten;
    MonotonicCounter           mFramesRead;
    MonotonicCounter           mTimestampPosition;
@@ -139,6 +142,7 @@ protected:
    const android::sp<StreamDeviceCallback>   mDeviceCallback;

    AtomicRequestor            mRequestDisconnect;

};

} /* namespace aaudio */
+3 −0
Original line number Diff line number Diff line
@@ -179,6 +179,9 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder)
                selectedDeviceId
        );

        // Set it here so it can be logged by the destructor if the open failed.
        mAudioRecord->setCallerName(kCallerName);

        // Did we get a valid track?
        status_t status = mAudioRecord->initCheck();
        if (status != OK) {
+3 −0
Original line number Diff line number Diff line
@@ -173,6 +173,9 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder)
            selectedDeviceId
    );

    // Set it here so it can be logged by the destructor if the open failed.
    mAudioTrack->setCallerName(kCallerName);

    // Did we get a valid track?
    status_t status = mAudioTrack->initCheck();
    if (status != NO_ERROR) {
+4 −0
Original line number Diff line number Diff line
@@ -170,6 +170,10 @@ AudioRecord::~AudioRecord()

    mediametrics::LogItem(mMetricsId)
        .set(AMEDIAMETRICS_PROP_EVENT, AMEDIAMETRICS_PROP_EVENT_VALUE_DTOR)
        .set(AMEDIAMETRICS_PROP_CALLERNAME,
                mCallerName.empty()
                ? AMEDIAMETRICS_PROP_VALUE_UNKNOWN
                : mCallerName.c_str())
        .set(AMEDIAMETRICS_PROP_STATUS, (int32_t)mStatus)
        .record();

+4 −0
Original line number Diff line number Diff line
@@ -301,6 +301,10 @@ AudioTrack::~AudioTrack()

    mediametrics::LogItem(mMetricsId)
        .set(AMEDIAMETRICS_PROP_EVENT, AMEDIAMETRICS_PROP_EVENT_VALUE_DTOR)
        .set(AMEDIAMETRICS_PROP_CALLERNAME,
                mCallerName.empty()
                ? AMEDIAMETRICS_PROP_VALUE_UNKNOWN
                : mCallerName.c_str())
        .set(AMEDIAMETRICS_PROP_STATE, stateToString(mState))
        .set(AMEDIAMETRICS_PROP_STATUS, (int32_t)mStatus)
        .record();
Loading