Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c169366f authored by Brian Colonna's avatar Brian Colonna
Browse files

Moved biometric sensor selected check into LPKV

This change moves all of the mBiometricUnlock.installedAndSelected()
checks from inside the biometric sensor implementation to
LockPatternKeyguardView.  There are several reasons for this change:

1) Instead of constructing a BiometricUnlock object and asking it if
it's enabled, LPKV can check this for itself and not even bother
constructing it if it's not enabled.

2) Since mBiometricUnlock will not be constructed if biometric unlock
isn't enabled, LPKV can simply do null checks to see if it should call
biometric unlock functions.  So it serves the dual-purpose of ensuring
there will be no null-pointer exceptions with regards to using the
biometric unlock.

3) This greatly reduces the chance of bugs being introduced into
non-biometric unlock methods because no biometric unlock calls will be
attempted if biometric unlock is not enabled.  Previously, the calls
would be made and then the biometric unlock would check if it was
enabled and return, which was not only bug-prone, but also
inefficient.

4) This simplifies the biometric unlock interface by removing an
unnecessary function call.

5) The biometric unlock implementations do not have to check if they
are installed every time they do something, which greatly cleans up
biometric unlock implementations.  It makes much more sense for the
biometric unlock functions to be able to assume that they aren't
being called unless they should be.

6) Eventually when there is more than one possible biometric unlock
method, it will make much more sense for LPKV to be in charge of
what is constructed and what isn't.

Change-Id: I5437ac05d8ceb2b182fe372cd6c75ad944ade28f
parent 8c44c181
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment