summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keystore/java/android/security/keystore/AttestationUtils.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/keystore/java/android/security/keystore/AttestationUtils.java b/keystore/java/android/security/keystore/AttestationUtils.java
index be865a02a945..3980d3a0203b 100644
--- a/keystore/java/android/security/keystore/AttestationUtils.java
+++ b/keystore/java/android/security/keystore/AttestationUtils.java
@@ -293,6 +293,11 @@ public abstract class AttestationUtils {
} catch (SecurityException e) {
throw e;
} catch (Exception e) {
+ // If a DeviceIdAttestationException was previously wrapped with some other type,
+ // let's throw the original exception instead of wrapping it yet again.
+ if (e.getCause() instanceof DeviceIdAttestationException) {
+ throw (DeviceIdAttestationException) e.getCause();
+ }
throw new DeviceIdAttestationException("Unable to perform attestation", e);
}
}