Better error code checking for missing device ID. am: b77a30bf3d

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16624955

Change-Id: Ic02ad8f4ddef3b49731ffe8c138a4d946c43a965
This commit is contained in:
Alex Dale
2022-01-14 22:58:57 +00:00
committed by Automerger Merge Worker

View File

@@ -679,8 +679,14 @@ CdmResponseType CryptoSession::GetInternalDeviceUniqueId(
const bool use_null_device_id = WithStaticFieldReadLock(
"GetInternalDeviceUniqueId() use_null_device_id", [&] {
if (requested_security_level_ != kLevelDefault) return false;
return sts == OEMCrypto_ERROR_KEYBOX_INVALID &&
needs_keybox_provisioning_;
if (!needs_keybox_provisioning_) return false;
if (sts != OEMCrypto_ERROR_KEYBOX_INVALID &&
sts != OEMCrypto_ERROR_NO_DEVICEID) {
// Logging other error for debugging, but null device
// ID should still be returned.
LOGE("Unexpected error: sts = %d", sts);
}
return true;
});
if (use_null_device_id) {
LOGD("Using null device ID");