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

Commit 2e82d316 authored by Ray Essick's avatar Ray Essick
Browse files

Nuplayer logging empty records to media.metrics

Changes to ensure that nuplayer always reported a particular set
of metrics through android.media.MediaPlayer.getMetrics() changed
the shape of what we should have considered as an empty record.
This caused some noise in the reported media metrics logs.

Also removed a no-longer-wanted ALOGD() diagnostic.

Bug: 36658856
Test: read 'dumpsys media.metrics' output
(cherry picked from commit e4ae1710)

Change-Id: I2400e3636bb395aa5f46faf0142b2767f4fad610
parent 34bc4d97
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1535,8 +1535,6 @@ void NuPlayer::onPause() {
    if (driver != NULL) {
        int64_t now = systemTime();
        int64_t played = now - mLastStartedPlayingTimeNs;
        ALOGD("played from %" PRId64 " to %" PRId64 " = %" PRId64 ,
              mLastStartedPlayingTimeNs, now, played);

        driver->notifyMorePlayingTimeUs((played+500)/1000);
    }
+6 −2
Original line number Diff line number Diff line
@@ -583,8 +583,12 @@ void NuPlayerDriver::logMetrics(const char *where) {
        return;
    }

    // only bother to log non-empty records
    if (mAnalyticsItem->count() > 0) {
    // log only non-empty records
    // we always updateMetrics() before we get here
    // and that always injects 2 fields (duration and playing time) into
    // the record.
    // So the canonical "empty" record has 2 elements in it.
    if (mAnalyticsItem->count() > 2) {

        mAnalyticsItem->setFinalized(true);
        mAnalyticsItem->selfrecord();