Skip to content

Commit

Permalink
Goodix FP HAL: Be quiet!
Browse files Browse the repository at this point in the history
The FP HAL spams like hell when using the fingerprint reader.
Touching the reader with the correct finger causes 272(!) logcat lines. This slows the wake up significantly...
Since there is no switch built into the HAL to disable this output, just shim the whole log function to return nothing.

A good indicator of how much the spamming slows down the wake up are the physical buttons. They light up quite fast but the screen is activated only after all the logging is done.
With this shim in place the screen and buttons light up nearly simultaneously.

Change-Id: Ic51e8c2ddd7588fdb14a4ecf62b26dd8504c5e16
  • Loading branch information
Jan Engelmohr authored and Razziell committed May 31, 2019
1 parent 49d00a9 commit b16f696
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/private
BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor

# Shims
TARGET_LD_SHIM_LIBS := /vendor/bin/mm-qcamera-daemon|libshims_qcamera-daemon.so
TARGET_LD_SHIM_LIBS += \
/vendor/bin/mm-qcamera-daemon|libshims_qcamera-daemon.so \
/vendor/lib64/hw/gxfingerprint.default.so|fakelogprint.so:/vendor/lib64/hw/fingerprint.goodix.so|fakelogprint.so:/vendor/bin/gx_fpd|fakelogprint.so

# Treble
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
Expand Down
3 changes: 2 additions & 1 deletion device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ PRODUCT_PACKAGES += \

# Fingerprint
PRODUCT_PACKAGES += \
[email protected]_markw
[email protected]_markw \
fakelogprint

# FM
PRODUCT_PACKAGES += \
Expand Down
14 changes: 14 additions & 0 deletions libshims/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ LOCAL_SANITIZE := never
LOCAL_MODULE_CLASS := SHARED_LIBRARIES

include $(BUILD_SHARED_LIBRARY)

# fake print lib for hexedited fingerprint libs
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := \
liblog
LOCAL_SRC_FILES := fakelogprint/fakelogprint.cpp

LOCAL_MODULE := fakelogprint
LOCAL_MODULE_TAGS := optional

LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_CLASS := SHARED_LIBRARIES

include $(BUILD_SHARED_LIBRARY)
8 changes: 8 additions & 0 deletions libshims/fakelogprint/fakelogprint.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <log/log_transport.h>
#include <private/android_filesystem_config.h>
#include <private/android_logger.h>

int __android_log_print(int prio, const char* tag, const char* fmt, ...) {
// Goodix: please don't spam that much!
return 0;
}

0 comments on commit b16f696

Please sign in to comment.