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

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

Change-Id: Iae13e720334cc30f98e2faa9bf7810d65e174c76
This commit is contained in:
Alex Dale
2022-01-14 23:10:59 +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");