Merge "Exclude the default CDM from metrics history." into udc-dev

This commit is contained in:
Alex Dale
2023-05-03 18:44:06 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 1 deletions

View File

@@ -565,6 +565,10 @@ CdmResponseType WvContentDecryptionModule::GetCurrentMetricsInternal(
void WvContentDecryptionModule::SaveMetrics(
const CdmIdentifier& identifier, drm_metrics::WvCdmMetrics&& metrics) {
if (saved_metrics_snapshots_ == nullptr) return;
// The DRM plugin opens and closes many CDMs using the default
// identifier. These metrics are not needed when checking the
// metric history.
if (identifier.IsEquivalentToDefault()) return;
saved_metrics_snapshots_->PushMetrics(
WvMetricsSnapshot::MakeSnapshot(identifier, std::move(metrics)));
}