diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl index d6ebbb6208..b0bfa3084e 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl @@ -53,4 +53,5 @@ interface ISessionCallback { void onEnrollmentsRemoved(in int[] enrollmentIds); void onAuthenticatorIdRetrieved(in long authenticatorId); void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl index 2e3cd950f6..c1aa3fcf80 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl @@ -227,4 +227,10 @@ interface ISessionCallback { * current set of enrollments. */ void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + + /** + * This method notifes the client that this session has closed. + * The client must not make any more calls to this session. + */ + void onSessionClosed(); } diff --git a/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp b/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp index 4cc8b4afa0..936fcc69e5 100644 --- a/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp +++ b/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp @@ -120,6 +120,8 @@ class SessionCallback : public BnSessionCallback { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); } + private: std::promise invocation_promise_; }; 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 13c2b05081..3a977178ff 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 @@ -50,4 +50,5 @@ interface ISessionCallback { void onEnrollmentsRemoved(in int[] enrollmentIds); void onAuthenticatorIdRetrieved(in long authenticatorId); void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl index fde1df753d..cf3a271ef6 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl @@ -200,4 +200,10 @@ interface ISessionCallback { * current set of enrollments. */ void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + + /** + * This method notifes the client that this session has closed. + * The client must not make any more calls to this session. + */ + void onSessionClosed(); } diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp index c035407c7e..f030f138f5 100644 --- a/biometrics/fingerprint/aidl/default/Session.cpp +++ b/biometrics/fingerprint/aidl/default/Session.cpp @@ -219,11 +219,11 @@ ndk::ScopedAStatus Session::resetLockout(int32_t cookie, const keymaster::Hardwa return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::close(int32_t cookie) { +ndk::ScopedAStatus Session::close(int32_t /*cookie*/) { LOG(INFO) << "close"; CHECK(mCurrentState == SessionState::IDLING) << "Can't close a non-idling session. Crashing."; mCurrentState = SessionState::CLOSED; - mCb->onStateChanged(cookie, mCurrentState); + mCb->onSessionClosed(); return ndk::ScopedAStatus::ok(); } diff --git a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp index 894fdfe362..885f703d5b 100644 --- a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp +++ b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp @@ -119,6 +119,8 @@ class SessionCallback : public BnSessionCallback { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); } + private: bool mIsPromiseValid; std::vector mInvocations;