16/n: Introduce ClientMonitor#FinishCallback
The main purpose of this CL is to decouple ClientMonitor's "finishing" from the onError, onAcquired, onAuthenticated, etc callback handlers. This will allow us to eventually move all operations into ClientMonitor subclasses (think generateChallenge, revokeChallenge, etc which are synchronous). We can then introduce a scheduler to ensure __all__ HAL operations are performed serially, not just the current ClientMonitor implementations. Bug: 157790417 However, since things are still a bit intertwined, a few additional changes are also necessary. 1) Added FinishCallback - All ClientMonitors are responsible for invoking this callback, notifying its owner that the current operation is complete 2) Added Cancellable - only Authenticate, Enroll (in other words, AcquisitionClient subclasses) are cancellable. Remainder of operations are "system" things and should never be canceled. In addition, the current HIDL contract is vague as to what the expected behavior would be if cancel() was invoked while one of the other operations are in process 3) Added ErrorConsumer - only Authenticate, Enroll (in other words, AcquisitionClient subclasses) receive onError from the HAL This change should be functionally equivalent, except the following: 1) onError is now only applicable to Authenticate, Enroll 2) Cancel is now only applicable to Authenticate, Enroll Test: On fingerprint and face devices, do the following: 1) Internal cleanup (unknown framework template, unknown HAL template) by modifying Fingerprint/FaceUtils 2) Enroll 3) Lockout on fingerprint/face devices 4) Auth (lockscreen, BiometricPrompt) success/reject 5) Remove templates from settings Change-Id: Icce99dbdb0aa076bc1dddd3f3c9ea74d4960df93
Loading
Please register or sign in to comment