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

Commit 4846d869 authored by d34d's avatar d34d Committed by Andy Mast
Browse files

Add fingerprint to DB before calling clients

Some clients may call getEnrolledFingerprints when they receive
onEnrollResult.  If the settings database is not updated before
that call there will be a mismatch between the fingerprints stored
natively, and those in the settings database, and when merging the two
lists the new fingerprint will end up being removed from the native
storage.

Change-Id: Ic45423f73939213b85c727cd6cbb048231605b47
parent a8599f5d
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -196,6 +196,12 @@ public class FingerprintService extends SystemService {
                    final int fingerId = arg1;
                    final int remaining = arg2;
                    if (mState == STATE_ENROLLING) {
                        // Update the database with new finger id.
                        if (remaining == 0) {
                            FingerprintUtils.addFingerprintIdForUser(fingerId,
                                    mContext, clientData.userId);
                            newState = STATE_IDLE;
                        }
                        try {
                            if (clientData != null && clientData.receiver != null) {
                                clientData.receiver.onEnrollResult(fingerId, remaining);
@@ -204,13 +210,6 @@ public class FingerprintService extends SystemService {
                            Slog.e(TAG, "can't send message to client. Did it die?", e);
                            it.remove();
                        }
                        // Update the database with new finger id.
                        // TODO: move to client code (Settings)
                        if (remaining == 0) {
                            FingerprintUtils.addFingerprintIdForUser(fingerId,
                                    mContext, clientData.userId);
                            newState = STATE_IDLE;
                        }
                    } else {
                        if (DEBUG) Slog.w(TAG, "Client not enrolling");
                        break;