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

Commit 60c0c5e2 authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: remove LOG_ALWAYS_FATAL_IF from metrics

Old assert was for debugging. No longer needed.
Caused a CTS failure in MediaMetrics logging.

Bug: 155188361
Test: atest CtsNativeMediaAAudioTestCases
Test: adb shell dumpsys media.metrics
Change-Id: I592937d6a0683faf6835d3f0d5a982d02f59e7a9
parent ec660f18
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ aaudio_result_t AudioStream::open(const AudioStreamBuilder& builder)
}

void AudioStream::logOpen() {
    LOG_ALWAYS_FATAL_IF(mMetricsId.size() == 0, "mMetricsId is empty!");
    if (mMetricsId.size() > 0) {
        android::mediametrics::LogItem(mMetricsId)
                .set(AMEDIAMETRICS_PROP_PERFORMANCEMODE,
                     AudioGlobal_convertPerformanceModeToText(getPerformanceMode()))
@@ -114,14 +114,16 @@ void AudioStream::logOpen() {
                     AudioGlobal_convertSharingModeToText(getSharingMode()))
                .record();
    }
}

void AudioStream::logBufferState() {
    LOG_ALWAYS_FATAL_IF(mMetricsId.size() == 0, "mMetricsId is empty!");
    if (mMetricsId.size() > 0) {
        android::mediametrics::LogItem(mMetricsId)
                .set(AMEDIAMETRICS_PROP_BUFFERSIZEFRAMES, (int32_t) getBufferSize())
                .set(AMEDIAMETRICS_PROP_UNDERRUN, (int32_t) getXRunCount())
                .record();
    }
}

aaudio_result_t AudioStream::systemStart() {
    std::lock_guard<std::mutex> lock(mStreamLock);