OSDN Git Service

Fix fingerprint listening state race conditions
authorJorim Jaggi <jjaggi@google.com>
Fri, 21 Aug 2015 01:20:02 +0000 (18:20 -0700)
committerJorim Jaggi <jjaggi@google.com>
Fri, 21 Aug 2015 19:29:05 +0000 (19:29 +0000)
commit86bed40605e407459496ee2bfdf6b8af1ae1a581
treebb55ec35000b1e43a95f3b4985fb4313f1887123
parent446c00a2919da5b4ea0bdf08f72ac4f95125ea45
Fix fingerprint listening state race conditions

When calling cancel() on the cancellation signal, it doesn't happen
immediately. Now, because of a state messup during boot, we go
through the sequence

startListeningForFingerprint
stopListeningForFingerprint
startListeningForFingerprint

However, the cancellation callback from stopListeningForFingeprint
happened AFTER the second startListeningForFingerprint, so we assumed
that fingerprint detection was not running anymore but in reality it
was - leading to weird states and all kinds of small state messups.

Introduce a state machine to track when we we called cancel but
waiting for the confirmation of FingerprintService in order to track
this properly.

Bug: 23380500
Change-Id: I403479fb749cf7c22b73611b69698e8b771777d0
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java