Merge "Keystore 2.0: Silence common error on operation abort."
This commit is contained in:
@@ -18,6 +18,7 @@ package android.security.keystore2;
|
|||||||
|
|
||||||
import android.app.ActivityThread;
|
import android.app.ActivityThread;
|
||||||
import android.hardware.biometrics.BiometricManager;
|
import android.hardware.biometrics.BiometricManager;
|
||||||
|
import android.hardware.security.keymint.ErrorCode;
|
||||||
import android.security.GateKeeper;
|
import android.security.GateKeeper;
|
||||||
import android.security.KeyStore;
|
import android.security.KeyStore;
|
||||||
import android.security.KeyStoreException;
|
import android.security.KeyStoreException;
|
||||||
@@ -183,15 +184,19 @@ abstract class KeyStoreCryptoOperationUtils {
|
|||||||
try {
|
try {
|
||||||
operation.abort();
|
operation.abort();
|
||||||
} catch (KeyStoreException e) {
|
} catch (KeyStoreException e) {
|
||||||
// We log this error, but we can afford to ignore it. Dropping the reference
|
// Invalid operation handle is very common at this point. It occurs every time
|
||||||
// to the KeyStoreOperation is enough to clean up all related resources even
|
// an already finalized operation gets aborted.
|
||||||
// in the Keystore daemon. We log it anyway, because it may indicate some
|
if (e.getErrorCode() != ErrorCode.INVALID_OPERATION_HANDLE) {
|
||||||
// underlying problem that is worth debugging.
|
// This error gets logged but ignored. Dropping the reference
|
||||||
Log.w(
|
// to the KeyStoreOperation is enough to clean up all related resources even
|
||||||
"KeyStoreCryptoOperationUtils",
|
// in the Keystore daemon. It gets logged anyway, because it may indicate some
|
||||||
"Encountered error trying to abort a keystore operation.",
|
// underlying problem that is worth debugging.
|
||||||
e
|
Log.w(
|
||||||
);
|
"KeyStoreCryptoOperationUtils",
|
||||||
|
"Encountered error trying to abort a keystore operation.",
|
||||||
|
e
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user