Support Face Virtual HAL operation latency randomization
Bug: 294254230
Test: atest android.hardware.biometrics.face.*
Change-Id: I1e0c2ba2f0f6756c79375b56c7d1a10f7f3bf5c4
diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h
index 8d9303c..b1e1388 100644
--- a/biometrics/face/aidl/default/FakeFaceEngine.h
+++ b/biometrics/face/aidl/default/FakeFaceEngine.h
@@ -60,6 +60,7 @@
void getAuthenticatorIdImpl(ISessionCallback* cb);
void invalidateAuthenticatorIdImpl(ISessionCallback* cb);
void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/);
+ int32_t getLatency(const std::vector<std::optional<std::int32_t>>& latencyVec);
virtual std::string toString() const {
std::ostringstream os;
@@ -71,6 +72,7 @@
std::mt19937 mRandom;
private:
+ int32_t getRandomInRange(int32_t bound1, int32_t bound2);
static constexpr int32_t FACE_ACQUIRED_VENDOR_BASE = 1000;
static constexpr int32_t FACE_ERROR_VENDOR_BASE = 1000;
std::pair<AcquiredInfo, int32_t> convertAcquiredInfo(int32_t code);