From 6d63dc3862191a8aa4ed67227a06f5983478637a Mon Sep 17 00:00:00 2001 From: Tim Zimmermann Date: Mon, 29 Jan 2024 17:47:27 +0100 Subject: [PATCH] aidl: fingerprint: Only call onEnrollmentsEnumerated when finished * Otherwise only one fingerprint can be registered Change-Id: I89f4be25d060f461ca6b6e46d3ce7c601828c914 --- aidl/fingerprint/Session.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aidl/fingerprint/Session.cpp b/aidl/fingerprint/Session.cpp index 6f65046..e5429f6 100644 --- a/aidl/fingerprint/Session.cpp +++ b/aidl/fingerprint/Session.cpp @@ -412,9 +412,12 @@ void Session::notify(const fingerprint_msg_t* msg) { LOG(DEBUG) << "onEnumerate(fid=" << msg->data.enumerated.finger.fid << ", gid=" << msg->data.enumerated.finger.gid << ", rem=" << msg->data.enumerated.remaining_templates << ")"; - std::vector enrollments; + static std::vector enrollments; enrollments.push_back(msg->data.enumerated.finger.fid); - mCb->onEnrollmentsEnumerated(enrollments); + if (msg->data.enumerated.remaining_templates == 0) { + mCb->onEnrollmentsEnumerated(enrollments); + enrollments.clear(); + } } break; } } -- 2.20.1