Log cleanup and reformatting for core/ (Part 2-6)
[ Merge of http://go/wvgerrit/83423 ] [ Merge of http://go/wvgerrit/83424 ] [ Merge of http://go/wvgerrit/83425 ] [ Merge of http://go/wvgerrit/83426 ] [ Merge of http://go/wvgerrit/83427 ] Types of cleanup: - Removed function / class prefixes from the logs. - Fixed log string format options to match the types passed - Corrected small spelling mistakes / typos - _Tried_ to make the log format more consistent - Added static_cast<int> conversion on enumerations when logged - Changed several LOGE to LOGW and vice versa - Used LOGE if the triggering condition stops the method/function from completing its task - Used LOGW if the triggering condition changes the expected outcome but does not stop the rest of the method/function's task - Changed several instances of `NULL` to `nullptr` - Ran clang-format on files after cleanup This is part of a larger code quality effort in Widevine DRM. Test: WV linux unittests and WV Android unit tests Bug: 134460638 Bug: 134365840 Bug: 136123217 Change-Id: I958ec70ef99eef95c38dbebd7a1acd62ef304145
This commit is contained in:
@@ -52,7 +52,7 @@ bool PolicyEngine::CanDecryptContent(const KeyId& key_id) {
|
||||
if (license_keys_->IsContentKey(key_id)) {
|
||||
return license_keys_->CanDecryptContent(key_id);
|
||||
} else {
|
||||
LOGE("PolicyEngine::CanDecryptContent Key '%s' not in license.",
|
||||
LOGE("Provided content key is not in license: key_id = %s",
|
||||
b2a_hex(key_id).c_str());
|
||||
return false;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ void PolicyEngine::UpdateLicense(const License& license) {
|
||||
if (!license.has_policy()) return;
|
||||
|
||||
if (kLicenseStateExpired == license_state_) {
|
||||
LOGD("PolicyEngine::UpdateLicense: updating an expired license");
|
||||
LOGD("Updating an expired license");
|
||||
}
|
||||
|
||||
policy_.MergeFrom(license.policy());
|
||||
@@ -299,8 +299,8 @@ CdmResponseType PolicyEngine::Query(CdmQueryMap* query_response) {
|
||||
|
||||
CdmResponseType PolicyEngine::QueryKeyAllowedUsage(
|
||||
const KeyId& key_id, CdmKeyAllowedUsage* key_usage) {
|
||||
if (NULL == key_usage) {
|
||||
LOGE("PolicyEngine::QueryKeyAllowedUsage: no key_usage provided");
|
||||
if (key_usage == nullptr) {
|
||||
LOGE("Output parameter |key_usage| not provided");
|
||||
return PARAMETER_NULL;
|
||||
}
|
||||
if (license_keys_->GetAllowedUsage(key_id, key_usage)) {
|
||||
|
||||
Reference in New Issue
Block a user