Merge "Log metric when generateKeyPair throws exception" into sc-dev

This commit is contained in:
Alex Johnston
2021-03-08 17:24:59 +00:00
committed by Android (Google) Code Review

View File

@@ -5774,6 +5774,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
if (generationResult != KeyChain.KEY_GEN_SUCCESS) {
Log.e(LOG_TAG, String.format(
"KeyChain failed to generate a keypair, error %d.", generationResult));
logGenerateKeyPairFailure(caller, isCredentialManagementApp);
switch (generationResult) {
case KeyChain.KEY_GEN_STRONGBOX_UNAVAILABLE:
throw new ServiceSpecificException(
@@ -5783,7 +5784,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
throw new UnsupportedOperationException(
"Device does not support Device ID attestation.");
default:
logGenerateKeyPairFailure(caller, isCredentialManagementApp);
return false;
}
}