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

Commit 4cb17881 authored by Hao Dong's avatar Hao Dong Committed by Android (Google) Code Review
Browse files

Merge "Add BiometricPrompt.CryptoObject.getOpId()." into main

parents 1f7440d1 3013db9a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18633,6 +18633,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
@@ -14,3 +14,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"
}