Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3013db9a authored by Hao Dong's avatar Hao Dong
Browse files

Add BiometricPrompt.CryptoObject.getOpId().

Test: m CtsVerifier
API-Coverage-Bug: 307601768
Bug: 307601768

Change-Id: Iec0feca0664e17449a8c981e5ee7a14f37360069
parent 2a9682ce
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18563,6 +18563,7 @@ package android.hardware.biometrics {
    method @Deprecated @Nullable public android.security.identity.IdentityCredential getIdentityCredential();
    method @FlaggedApi("android.hardware.biometrics.add_key_agreement_crypto_object") @Nullable public javax.crypto.KeyAgreement getKeyAgreement();
    method @Nullable public javax.crypto.Mac getMac();
    method @FlaggedApi("android.hardware.biometrics.get_op_id_crypto_object") public long getOpId();
    method @Nullable public android.security.identity.PresentationSession getPresentationSession();
    method @Nullable public java.security.Signature getSignature();
  }
+9 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.Manifest.permission.USE_BIOMETRIC;
import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL;
import static android.hardware.biometrics.BiometricManager.Authenticators;
import static android.hardware.biometrics.Flags.FLAG_ADD_KEY_AGREEMENT_CRYPTO_OBJECT;
import static android.hardware.biometrics.Flags.FLAG_GET_OP_ID_CRYPTO_OBJECT;

import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
@@ -851,6 +852,14 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
        public @Nullable KeyAgreement getKeyAgreement() {
            return super.getKeyAgreement();
        }

        /**
         * Get the operation handle associated with this object or 0 if none.
         */
        @FlaggedApi(FLAG_GET_OP_ID_CRYPTO_OBJECT)
        public long getOpId() {
            return super.getOpId();
        }
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ public class CryptoObject {
     * @hide
     * @return the opId associated with this object or 0 if none
     */
    public final long getOpId() {
    public long getOpId() {
        if (mCrypto == null) {
            return 0;
        } else if (mCrypto instanceof IdentityCredential) {
+7 −0
Original line number Diff line number Diff line
@@ -7,3 +7,10 @@ flag {
  bug: "282058146"
}

flag {
  name: "get_op_id_crypto_object"
  namespace: "biometrics"
  description: "Feature flag for adding a get operation id api to CryptoObject."
  bug: "307601768"
}