DrmManager: locally aggregate API metrics

Aggregate DrmManager API invocation counts per plugin over at least
fixed period of time before sending metrics to mediametrics service.

The default period is 1 day; the period is configurable through the
property drmmanager.metrics.period.

Bug: 134789967
Test: dumpsys media.metrics
Change-Id: I2cf28f1dfaa485ca319360705b872eed995b3d7f
This commit is contained in:
Robert Shih
2020-02-07 15:01:57 -08:00
parent 93fb84c8d5
commit 7bcf792dd8
5 changed files with 179 additions and 42 deletions

View File

@@ -130,13 +130,14 @@ DrmManagerService::DrmManagerService() :
mDrmManager(NULL) {
ALOGV("created");
mDrmManager = new DrmManager();
mDrmManager->initMetricsLooper();
mDrmManager->loadPlugIns();
}
DrmManagerService::~DrmManagerService() {
ALOGV("Destroyed");
mDrmManager->unloadPlugIns();
delete mDrmManager; mDrmManager = NULL;
mDrmManager = NULL;
}
int DrmManagerService::addUniqueId(bool isNative) {