fingerprint: inscreen: enable sensor on ShowFODView
authorJesse Chan <jc@lineageos.org>
Fri, 8 May 2020 16:08:23 +0000 (00:08 +0800)
committerJan Altensen <info@stricted.net>
Sat, 16 May 2020 15:41:10 +0000 (17:41 +0200)
Enabling sensor on Press is slow and frequent on/off
switching on Press/Release leads to unexpected results.

Looking into Kernel, the purpose of FOD_ENABLE/FOD_DISABLE
commands are to save battery. (ts->lowpower_mode) It is not
meant to handle fingerprint authentication on Press/Release.

It is expected that FOD is in ENABLED state whenever the user
is EXPECTED to use fingerprint authentication soon.

Thus, this patch moved FOD_ENABLE/FOD_DISABLE from
OnPress/onRelease to onShowFODView/onHideFODView so the
fingerprint authentication can be faster and the logic makes
more sense.

Change-Id: Id94b71acd55038d6eda7a1a89dde5fdf5a1e298f
Signed-off-by: Jesse Chan <jc@lineageos.org>
hidl/fingerprint/inscreen/FingerprintInscreen.cpp

index 47211b1645603b609513f98e8ba85662aa99a6e5..1b1f3137b349591f8c2fb375e367bd7089497a8d 100644 (file)
@@ -80,18 +80,15 @@ Return<void> FingerprintInscreen::onStartEnroll() { return Void(); }
 
 Return<void> FingerprintInscreen::onFinishEnroll() { return Void(); }
 
-Return<void> FingerprintInscreen::onPress() {
-    set(TSP_CMD_PATH, FOD_ENABLE);
-    return Void();
-}
+Return<void> FingerprintInscreen::onPress() { return Void(); }
 
-Return<void> FingerprintInscreen::onRelease() {
-    set(TSP_CMD_PATH, FOD_DISABLE);
+Return<void> FingerprintInscreen::onRelease() { return Void(); }
+
+Return<void> FingerprintInscreen::onShowFODView() {
+    set(TSP_CMD_PATH, FOD_ENABLE);
     return Void();
 }
 
-Return<void> FingerprintInscreen::onShowFODView() { return Void(); }
-
 Return<void> FingerprintInscreen::onHideFODView() {
     set(TSP_CMD_PATH, FOD_DISABLE);
     return Void();