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

Commit 58a37f8b authored by Robert Shih's avatar Robert Shih
Browse files

statsd_drm: skip empty pulled atoms

Bug: 184263266
Test: Local Testing of New Atoms/Metrics
Test: http://doc/1pY7g5Xl0_aZ8JC6chQWUg9LHeBsjf2rNtqdc62IMIo8
Change-Id: I789cf3fba8d1ce3ee7477026ee3bd5d57d70b601
parent 9a37b243
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -545,12 +545,13 @@ AStatsManager_PullAtomCallbackReturn MediaMetricsService::pullItems(
        return AStatsManager_PULL_SKIP;
    }
    std::lock_guard _l(mLock);
    bool dumped = false;
    for (auto &item : mPullableItems[key]) {
        if (const auto sitem = item.lock()) {
            dump2Statsd(sitem, data, mStatsdLog);
            dumped |= dump2Statsd(sitem, data, mStatsdLog);
        }
    }
    mPullableItems[key].clear();
    return AStatsManager_PULL_SUCCESS;
    return dumped ? AStatsManager_PULL_SUCCESS : AStatsManager_PULL_SKIP;
}
} // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -188,6 +188,11 @@ bool statsd_mediadrm_puller(
    (void) item->getString("plugin_metrics", &plugin_metrics);
    const auto plugin_raw(base64DecodeNoPad(plugin_metrics));

    if (serialized_metrics.size() == 0 && plugin_metrics.size() == 0) {
        ALOGD("statsd_mediadrm_puller skipping empty entry");
        return false;
    }

    std::string vendor;
    (void) item->getString("vendor", &vendor);
    std::string description;