Merge "Exclude the default CDM from metrics history." into udc-dev am: 2e84e8b5f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22957292 Change-Id: Id2d7277082d1c95195476ac7e23b0c1982f60100 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -47,7 +47,7 @@ struct CdmIdentifier {
|
||||
// to the default cdm. E.g. no spoid, origin or app package name. Use this
|
||||
// comparison in lieu of the == operator when checking to see if the
|
||||
// identifier would cause the default provisioned certificate to be used.
|
||||
bool IsEquivalentToDefault() {
|
||||
bool IsEquivalentToDefault() const {
|
||||
return spoid == EMPTY_SPOID && origin == EMPTY_ORIGIN &&
|
||||
app_package_name == EMPTY_APP_PACKAGE_NAME;
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user