From 4c9e74f53b0279f3d9bf2549d5bb102f2604794b Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 9 May 2020 00:08:23 +0800 Subject: [PATCH] fingerprint: inscreen: enable sensor on ShowFODView 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 --- hidl/fingerprint/inscreen/FingerprintInscreen.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hidl/fingerprint/inscreen/FingerprintInscreen.cpp b/hidl/fingerprint/inscreen/FingerprintInscreen.cpp index 47211b16..1b1f3137 100644 --- a/hidl/fingerprint/inscreen/FingerprintInscreen.cpp +++ b/hidl/fingerprint/inscreen/FingerprintInscreen.cpp @@ -80,18 +80,15 @@ Return FingerprintInscreen::onStartEnroll() { return Void(); } Return FingerprintInscreen::onFinishEnroll() { return Void(); } -Return FingerprintInscreen::onPress() { - set(TSP_CMD_PATH, FOD_ENABLE); - return Void(); -} +Return FingerprintInscreen::onPress() { return Void(); } -Return FingerprintInscreen::onRelease() { - set(TSP_CMD_PATH, FOD_DISABLE); +Return FingerprintInscreen::onRelease() { return Void(); } + +Return FingerprintInscreen::onShowFODView() { + set(TSP_CMD_PATH, FOD_ENABLE); return Void(); } -Return FingerprintInscreen::onShowFODView() { return Void(); } - Return FingerprintInscreen::onHideFODView() { set(TSP_CMD_PATH, FOD_DISABLE); return Void();