The app package name was not being reported to the media stats. This change adds the package name as part of the report to media stats. This is one of two parts to this change. The other part is in frameworks/av. Bug: 64584568 Test: Unit tests, GTS tests, tried with Google Play Movies. Change-Id: I1ca09db3a59d9a0950f424d977f8774dffd09c2b
75 lines
2.3 KiB
C++
75 lines
2.3 KiB
C++
// Copyright 2016 Google Inc. All Rights Reserved.
|
|
//
|
|
// CdmIdentifier - Struct that holds all the information necessary to
|
|
// uniquely identify a CdmEngine instance in the
|
|
// WvContentDecryptionModule multiplexing layer.
|
|
|
|
#ifndef CDM_BASE_CDM_IDENTIFIER_H_
|
|
#define CDM_BASE_CDM_IDENTIFIER_H_
|
|
|
|
#include <string>
|
|
|
|
#include "wv_cdm_constants.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
// CdmIdentifier contains all the information necessary to uniquely identify a
|
|
// distinct CdmEngine instance on Android. There should be a unique CdmEngine
|
|
// (and thus distinct storage space) for every combination of SPOID and origin.
|
|
struct CdmIdentifier {
|
|
// The Stable Per-Origin Identifier, or SPOID. May be blank on old, SPOID-less
|
|
// systems, in which case multiple apps with the same origin will share a
|
|
// CdmEngine and storage.
|
|
std::string spoid;
|
|
|
|
// The origin. May be blank if the app does not set an origin, which is
|
|
// the likely behavior of most non-web-browser apps.
|
|
std::string origin;
|
|
|
|
// The application package name provided by the application. This is used to
|
|
// provide a friendly name of the application package for the purposes of
|
|
// logging and metrics.
|
|
std::string app_package_name;
|
|
};
|
|
|
|
// Provide comparison operators
|
|
inline bool operator==(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
|
|
return lhs.spoid == rhs.spoid && lhs.origin == rhs.origin
|
|
&& lhs.app_package_name == rhs.app_package_name;
|
|
}
|
|
|
|
inline bool operator!=(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
|
|
return !(lhs == rhs);
|
|
}
|
|
|
|
inline bool operator<(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
|
|
return (lhs.spoid < rhs.spoid)
|
|
|| ((lhs.spoid == rhs.spoid)
|
|
&& (lhs.origin < rhs.origin
|
|
|| (lhs.origin == rhs.origin
|
|
&& lhs.app_package_name < rhs.app_package_name)));
|
|
}
|
|
|
|
inline bool operator>(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
|
|
return rhs < lhs;
|
|
}
|
|
|
|
inline bool operator<=(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
|
|
return !(lhs > rhs);
|
|
}
|
|
|
|
inline bool operator>=(const CdmIdentifier& lhs, const CdmIdentifier& rhs) {
|
|
return !(lhs < rhs);
|
|
}
|
|
|
|
// Provide default
|
|
static const CdmIdentifier kDefaultCdmIdentifier = {
|
|
EMPTY_SPOID,
|
|
EMPTY_ORIGIN,
|
|
EMPTY_APP_PACKAGE_NAME
|
|
};
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // CDM_BASE_CDM_IDENTIFIER_H_
|