Log metric when generateKeyPair throws exception
Bug: 181758899
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
atest android.devicepolicy.cts.CredentialManagementAppTest
Change-Id: Ib6f73ed1fcb1d7364281b5bd13523eafec30c729
This commit is contained in:
@@ -5684,6 +5684,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(
|
||||
@@ -5693,7 +5694,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
||||
throw new UnsupportedOperationException(
|
||||
"Device does not support Device ID attestation.");
|
||||
default:
|
||||
logGenerateKeyPairFailure(caller, isCredentialManagementApp);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user