Move [generate|revoke]Challenge under ISession.aidl

Bug: 171002801
Test: m android.hardware.biometrics.fingerprint-update-api
Test: atest VtsHalBiometricsFingerprintTargetTest
Change-Id: I2aa266b7b81003b7fd0ab0328833e5500de99908
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl
index 6ca6d16..c5c6786 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl
@@ -20,6 +20,4 @@
 interface IFingerprint {
   android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps();
   android.hardware.biometrics.fingerprint.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.ISessionCallback cb);
-  void generateChallenge(in int sensorId, in int userId, in int timeoutSec, in android.hardware.biometrics.fingerprint.IGenerateChallengeCallback cb);
-  void revokeChallenge(in int sensorId, in int userId, in long challenge, in android.hardware.biometrics.fingerprint.IRevokeChallengeCallback cb);
 }
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
deleted file mode 100644
index 063be60..0000000
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.biometrics.fingerprint;
-@VintfStability
-interface IGenerateChallengeCallback {
-  oneway void onChallengeGenerated(in int sensorId, in int userId, in long challenge);
-}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
deleted file mode 100644
index 23fc10f..0000000
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.biometrics.fingerprint;
-@VintfStability
-interface IRevokeChallengeCallback {
-  oneway void onChallengeRevoked(in int sensorId, in int userId, in long challenge);
-}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
index c1f66e3..00a08ba 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
@@ -18,6 +18,8 @@
 package android.hardware.biometrics.fingerprint;
 @VintfStability
 interface ISession {
+  void generateChallenge(in int cookie, in int timeoutSec);
+  void revokeChallenge(in int cookie, in long challenge);
   android.hardware.biometrics.common.ICancellationSignal enroll(in int cookie, in android.hardware.keymaster.HardwareAuthToken hat);
   android.hardware.biometrics.common.ICancellationSignal authenticate(in int cookie, in long operationId);
   android.hardware.biometrics.common.ICancellationSignal detectInteraction(in int cookie);
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
index 74ec077..b7a48a5 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
@@ -19,6 +19,8 @@
 @VintfStability
 interface ISessionCallback {
   void onStateChanged(in int cookie, in android.hardware.biometrics.fingerprint.SessionState state);
+  void onChallengeGenerated(in long challenge);
+  void onChallengeRevoked(in long challenge);
   void onAcquired(in android.hardware.biometrics.fingerprint.AcquiredInfo info, in int vendorCode);
   void onError(in android.hardware.biometrics.fingerprint.Error error, in int vendorCode);
   void onEnrollmentProgress(in int enrollmentId, int remaining);
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl
index 97f1a1e..e9daef1 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl
@@ -19,12 +19,14 @@
 @Backing(type="byte") @VintfStability
 enum SessionState {
   IDLING = 0,
-  ENROLLING = 1,
-  AUTHENTICATING = 2,
-  DETECTING_INTERACTION = 3,
-  ENUMERATING_ENROLLMENTS = 4,
-  REMOVING_ENROLLMENTS = 5,
-  GETTING_AUTHENTICATOR_ID = 6,
-  INVALIDATING_AUTHENTICATOR_ID = 7,
-  RESETTING_LOCKOUT = 8,
+  GENERATING_CHALLENGE = 1,
+  REVOKING_CHALLENGE = 2,
+  ENROLLING = 3,
+  AUTHENTICATING = 4,
+  DETECTING_INTERACTION = 5,
+  ENUMERATING_ENROLLMENTS = 6,
+  REMOVING_ENROLLMENTS = 7,
+  GETTING_AUTHENTICATOR_ID = 8,
+  INVALIDATING_AUTHENTICATOR_ID = 9,
+  RESETTING_LOCKOUT = 10,
 }
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl
index 4b907b4..3675aa4 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl
@@ -16,8 +16,6 @@
 
 package android.hardware.biometrics.fingerprint;
 
-import android.hardware.biometrics.fingerprint.IGenerateChallengeCallback;
-import android.hardware.biometrics.fingerprint.IRevokeChallengeCallback;
 import android.hardware.biometrics.fingerprint.ISession;
 import android.hardware.biometrics.fingerprint.ISessionCallback;
 import android.hardware.biometrics.fingerprint.SensorProps;
@@ -63,64 +61,4 @@
      * @return A new session
      */
     ISession createSession(in int sensorId, in int userId, in ISessionCallback cb);
-
-    /**
-     * generateChallenge:
-     *
-     * Begins a secure transaction request. Note that the challenge by itself is not useful. It only
-     * becomes useful when wrapped in a verifiable message such as a HardwareAuthToken.
-     *
-     * Canonical example:
-     *   1) User requests an operation, such as fingerprint enrollment.
-     *   2) Fingerprint enrollment cannot happen until the user confirms their lockscreen credential
-     *      (PIN/Pattern/Password).
-     *   3) However, the biometric subsystem does not want just "any" proof of credential
-     *      confirmation. It needs proof that the user explicitly authenticated credential in order
-     *      to allow addition of biometric enrollments.
-     * To secure this path, the following path is taken:
-     *   1) Upon user requesting fingerprint enroll, the framework requests
-     *      IFingerprint#generateChallenge
-     *   2) Framework sends the challenge to the credential subsystem, and upon credential
-     *      confirmation, a HAT is created, containing the challenge in the "challenge" field.
-     *   3) Framework sends the HAT to the HAL, e.g. ISession#enroll.
-     *   4) Implementation verifies the authenticity and integrity of the HAT.
-     *   5) Implementation now has confidence that the user entered their credential to allow
-     *      biometric enrollment.
-     *
-     * Note that the interface allows multiple in-flight challenges. For example, invoking
-     * generateChallenge(0, 0, timeoutSec, cb) twice does not invalidate the first challenge. The
-     * challenge is invalidated only when:
-     *   1) The provided timeout expires, or
-     *   2) IFingerprint#revokeChallenge is invoked
-     *
-     * For example, the following is a possible table of valid challenges:
-     * ----------------------------------------------
-     * | SensorId | UserId | ValidUntil | Challenge |
-     * |----------|--------|------------|-----------|
-     * | 0        | 0      | <Time1>    | <Random1> |
-     * | 0        | 0      | <Time2>    | <Random2> |
-     * | 1        | 0      | <Time3>    | <Random3> |
-     * | 0        | 10     | <Time4>    | <Random4> |
-     * ----------------------------------------------
-     *
-     * @param sensorId Sensor to associate the challenge with
-     * @param userId User to associate the challenge with
-     * @param timeoutSec Duration for which the challenge is valid for
-     * @param cb Callback to notify the framework
-     */
-    void generateChallenge(in int sensorId, in int userId, in int timeoutSec, in IGenerateChallengeCallback cb);
-
-    /**
-     * revokeChallenge:
-     *
-     * Revokes a challenge that was previously generated. Note that if an invalid combination of
-     * parameters is requested, the implementation must still notify the framework using the
-     * provided callback.
-     *
-     * @param sensorId Sensor that the revocation should apply to.
-     * @param userId User that the revocation should apply to.
-     * @param challenge Challenge that should be revoked.
-     * @param cb Used to notify the framework.
-     */
-    void revokeChallenge(in int sensorId, in int userId, in long challenge, in IRevokeChallengeCallback cb);
 }
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
deleted file mode 100644
index a51b188..0000000
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.biometrics.fingerprint;
-
-@VintfStability
-oneway interface IGenerateChallengeCallback {
-    /**
-     * Notifies the framework when a challenge is successfully generated.
-     */
-    void onChallengeGenerated(in int sensorId, in int userId, in long challenge);
-}
-
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
deleted file mode 100644
index eadba52..0000000
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.biometrics.fingerprint;
-
-@VintfStability
-oneway interface IRevokeChallengeCallback {
-    /**
-     * Notifies the framework when a challenge has been revoked.
-     */
-    void onChallengeRevoked(in int sensorId, in int userId, in long challenge);
-}
-
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
index 644e214..da767be 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
@@ -47,6 +47,62 @@
      */
 
     /**
+     * generateChallenge:
+     *
+     * Begins a secure transaction request. Note that the challenge by itself is not useful. It only
+     * becomes useful when wrapped in a verifiable message such as a HardwareAuthToken.
+     *
+     * Canonical example:
+     *   1) User requests an operation, such as fingerprint enrollment.
+     *   2) Fingerprint enrollment cannot happen until the user confirms their lockscreen credential
+     *      (PIN/Pattern/Password).
+     *   3) However, the biometric subsystem does not want just "any" proof of credential
+     *      confirmation. It needs proof that the user explicitly authenticated credential in order
+     *      to allow addition of biometric enrollments.
+     * To secure this path, the following path is taken:
+     *   1) Upon user requesting fingerprint enroll, the framework requests
+     *      IFingerprint#generateChallenge
+     *   2) Framework sends the challenge to the credential subsystem, and upon credential
+     *      confirmation, a HAT is created, containing the challenge in the "challenge" field.
+     *   3) Framework sends the HAT to the HAL, e.g. ISession#enroll.
+     *   4) Implementation verifies the authenticity and integrity of the HAT.
+     *   5) Implementation now has confidence that the user entered their credential to allow
+     *      biometric enrollment.
+     *
+     * Note that the interface allows multiple in-flight challenges. For example, invoking
+     * generateChallenge(0, 0, timeoutSec, cb) twice does not invalidate the first challenge. The
+     * challenge is invalidated only when:
+     *   1) The provided timeout expires, or
+     *   2) IFingerprint#revokeChallenge is invoked
+     *
+     * For example, the following is a possible table of valid challenges:
+     * ----------------------------------------------
+     * | SensorId | UserId | ValidUntil | Challenge |
+     * |----------|--------|------------|-----------|
+     * | 0        | 0      | <Time1>    | <Random1> |
+     * | 0        | 0      | <Time2>    | <Random2> |
+     * | 1        | 0      | <Time3>    | <Random3> |
+     * | 0        | 10     | <Time4>    | <Random4> |
+     * ----------------------------------------------
+     *
+     * @param cookie A unique number identifying this operation
+     * @param timeoutSec Duration for which the challenge is valid for
+     */
+    void generateChallenge(in int cookie, in int timeoutSec);
+
+    /**
+     * revokeChallenge:
+     *
+     * Revokes a challenge that was previously generated. Note that if an invalid combination of
+     * parameters is requested, the implementation must still notify the framework using the
+     * provided callback.
+     *
+     * @param cookie A unique number identifying this operation
+     * @param challenge Challenge that should be revoked.
+     */
+    void revokeChallenge(in int cookie, in long challenge);
+
+    /**
      * enroll:
      *
      * A request to add a fingerprint enrollment.
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
index 74792d8..4387f98 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
@@ -29,6 +29,16 @@
     void onStateChanged(in int cookie, in SessionState state);
 
     /**
+     * Notifies the framework when a challenge is successfully generated.
+     */
+    void onChallengeGenerated(in long challenge);
+
+    /**
+     * Notifies the framework when a challenge has been revoked.
+     */
+    void onChallengeRevoked(in long challenge);
+
+    /**
      * This method must only be used to notify the framework during the following states:
      *   1) SessionState::ENROLLING
      *   2) SessionState::AUTHENTICATING
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl
index 405b011..1de01ad 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl
@@ -25,6 +25,16 @@
     IDLING,
 
     /**
+     * The HAL is processing the ISession#generateChallenge request.
+     */
+    GENERATING_CHALLENGE,
+
+    /**
+     * The HAL is processing the ISession#revokeChallenge request.
+     */
+    REVOKING_CHALLENGE,
+
+    /**
      * The HAL is processing the ISession#enroll request.
      */
     ENROLLING,
diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.cpp b/biometrics/fingerprint/aidl/default/Fingerprint.cpp
index b907bf1..18ce0c8 100644
--- a/biometrics/fingerprint/aidl/default/Fingerprint.cpp
+++ b/biometrics/fingerprint/aidl/default/Fingerprint.cpp
@@ -60,17 +60,4 @@
     *return_val = SharedRefBase::make<Session>(cb);
     return ndk::ScopedAStatus::ok();
 }
-
-ndk::ScopedAStatus Fingerprint::generateChallenge(
-        int32_t /*sensorId*/, int32_t /*userId*/, int32_t /*timeoutSec*/,
-        const std::shared_ptr<IGenerateChallengeCallback>& /*cb*/) {
-    return ndk::ScopedAStatus::ok();
-}
-
-ndk::ScopedAStatus Fingerprint::revokeChallenge(
-        int32_t /*sensorId*/, int32_t /*userId*/, int64_t /*challenge*/,
-        const std::shared_ptr<IRevokeChallengeCallback>& /*cb*/) {
-    return ndk::ScopedAStatus::ok();
-}
-
 }  // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.h b/biometrics/fingerprint/aidl/default/Fingerprint.h
index 59cdd44..4e952ba 100644
--- a/biometrics/fingerprint/aidl/default/Fingerprint.h
+++ b/biometrics/fingerprint/aidl/default/Fingerprint.h
@@ -27,14 +27,6 @@
     ndk::ScopedAStatus createSession(int32_t sensorId, int32_t userId,
                                      const std::shared_ptr<ISessionCallback>& cb,
                                      std::shared_ptr<ISession>* _aidl_return) override;
-
-    ndk::ScopedAStatus generateChallenge(
-            int32_t sensorId, int32_t userId, int32_t timeoutSec,
-            const std::shared_ptr<IGenerateChallengeCallback>& cb) override;
-
-    ndk::ScopedAStatus revokeChallenge(
-            int32_t sensorId, int32_t userId, int64_t challenge,
-            const std::shared_ptr<IRevokeChallengeCallback>& cb) override;
 };
 
 }  // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp
index c2934a8..372066d 100644
--- a/biometrics/fingerprint/aidl/default/Session.cpp
+++ b/biometrics/fingerprint/aidl/default/Session.cpp
@@ -27,6 +27,14 @@
 
 Session::Session(std::shared_ptr<ISessionCallback> cb) : cb_(std::move(cb)) {}
 
+ndk::ScopedAStatus Session::generateChallenge(int32_t /*cookie*/, int32_t /*timeoutSec*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::revokeChallenge(int32_t /*cookie*/, int64_t /*challenge*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
 ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/,
                                    std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
     return ndk::ScopedAStatus::ok();
@@ -60,7 +68,7 @@
 }
 
 ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/,
-                                        const keymaster::HardwareAuthToken& /*hat*/) {
+                                                      const keymaster::HardwareAuthToken& /*hat*/) {
     return ndk::ScopedAStatus::ok();
 }
 
@@ -81,5 +89,4 @@
 ndk::ScopedAStatus Session::onUiReady() {
     return ndk::ScopedAStatus::ok();
 }
-
 }  // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Session.h b/biometrics/fingerprint/aidl/default/Session.h
index f7cba1b..05c570c 100644
--- a/biometrics/fingerprint/aidl/default/Session.h
+++ b/biometrics/fingerprint/aidl/default/Session.h
@@ -28,14 +28,19 @@
   public:
     explicit Session(std::shared_ptr<ISessionCallback> cb);
 
+    ndk::ScopedAStatus generateChallenge(int32_t cookie, int32_t timeoutSec) override;
+
+    ndk::ScopedAStatus revokeChallenge(int32_t cookie, int64_t challenge) override;
+
     ndk::ScopedAStatus enroll(int32_t cookie, const keymaster::HardwareAuthToken& hat,
                               std::shared_ptr<common::ICancellationSignal>* return_val) override;
 
-    ndk::ScopedAStatus authenticate(int32_t cookie, int64_t keystoreOperationId,
-                                    std::shared_ptr<common::ICancellationSignal>* return_val) override;
+    ndk::ScopedAStatus authenticate(
+            int32_t cookie, int64_t keystoreOperationId,
+            std::shared_ptr<common::ICancellationSignal>* return_val) override;
 
-    ndk::ScopedAStatus detectInteraction(int32_t cookie,
-                                         std::shared_ptr<common::ICancellationSignal>* return_val) override;
+    ndk::ScopedAStatus detectInteraction(
+            int32_t cookie, std::shared_ptr<common::ICancellationSignal>* return_val) override;
 
     ndk::ScopedAStatus enumerateEnrollments(int32_t cookie) override;
 
@@ -45,7 +50,7 @@
     ndk::ScopedAStatus getAuthenticatorId(int32_t cookie) override;
 
     ndk::ScopedAStatus invalidateAuthenticatorId(int32_t cookie,
-                                    const keymaster::HardwareAuthToken& hat) override;
+                                                 const keymaster::HardwareAuthToken& hat) override;
 
     ndk::ScopedAStatus resetLockout(int32_t cookie,
                                     const keymaster::HardwareAuthToken& hat) override;
diff --git a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
index 496badc..adb98ac 100644
--- a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
+++ b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
@@ -52,6 +52,14 @@
         return ndk::ScopedAStatus::ok();
     }
 
+    ndk::ScopedAStatus onChallengeGenerated(int64_t /*challenge*/) override {
+        return ndk::ScopedAStatus::ok();
+    }
+
+    ndk::ScopedAStatus onChallengeRevoked(int64_t /*challenge*/) override {
+        return ndk::ScopedAStatus::ok();
+    }
+
     ndk::ScopedAStatus onAcquired(AcquiredInfo /*info*/, int32_t /*vendorCode*/) override {
         return ndk::ScopedAStatus::ok();
     }