Add update context method to face and fingerprint HAL.

This is needed for changes that occur mid-operation and was lost
from the previous changes when switching from the single context
method to the overloaded approach.

Bug: 204584403
Test: atest VtsHalBiometricsFingerprintTargetTest VtsHalBiometricsFaceTargetTest

Change-Id: Ie917bce9de910a421e19130b6e518bd6fc85298e
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl
index 4b51bb1..3665534 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl
@@ -51,4 +51,5 @@
   android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context);
   android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context);
   android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context);
+  void onContextChanged(in android.hardware.biometrics.common.OperationContext context);
 }
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl
index bbe3632..a92b366 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl
@@ -461,4 +461,10 @@
 
     /* See ISession#detectInteraction() */
     ICancellationSignal detectInteractionWithContext(in OperationContext context);
+
+    /**
+     * This may be called while an authenticate, detect interaction, or enrollment operation is
+     * running when the context changes.
+     */
+    void onContextChanged(in OperationContext context);
 }
diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp
index 9e753e5..984a1a9 100644
--- a/biometrics/face/aidl/default/Session.cpp
+++ b/biometrics/face/aidl/default/Session.cpp
@@ -172,4 +172,8 @@
     return detectInteraction(out);
 }
 
+ndk::ScopedAStatus Session::onContextChanged(const common::OperationContext& /*context*/) {
+    return ndk::ScopedAStatus::ok();
+}
+
 }  // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h
index 0ce9e20..9db17d2 100644
--- a/biometrics/face/aidl/default/Session.h
+++ b/biometrics/face/aidl/default/Session.h
@@ -82,6 +82,8 @@
             const common::OperationContext& context,
             std::shared_ptr<common::ICancellationSignal>* out) override;
 
+    ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override;
+
   private:
     std::shared_ptr<ISessionCallback> cb_;
     std::mt19937 mRandom;