From 4f60724dac4a537184f6f2c4336fa8fc4ab63a58 Mon Sep 17 00:00:00 2001 From: Chenyang Zhong Date: Thu, 13 May 2021 03:05:45 -0400 Subject: [PATCH] sdm710-common: libqti-perfd-client: return a dummy value Return a positive integer for perf lock acquire and release so that Goodix/FPC fingerprint sensor blobs will not complain. Goodix: E [goodixHAL][gf_hal_milan_f_series]: goodix_perf_lock_acquire: Failed to acquire perf lock, err: 0 E [goodixHAL][gf_hal_milan_f_series]: goodix_perf_lock_release: Perf lock release error 0 FPC: E fpc_tac : fpc_perf_lock_acquire: Incorrect params, Failed to acquire perf lock, err E fpc_tac : fpc_perf_lock_release: Perf lock release error 0 Signed-off-by: Chenyang Zhong --- libqti-perfd-client/Android.bp | 1 + libqti-perfd-client/client.cpp | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libqti-perfd-client/Android.bp b/libqti-perfd-client/Android.bp index e5cb610..6852aa4 100644 --- a/libqti-perfd-client/Android.bp +++ b/libqti-perfd-client/Android.bp @@ -12,5 +12,6 @@ cc_library_shared { ], shared_libs: [ "libutils", + "liblog", ], } diff --git a/libqti-perfd-client/client.cpp b/libqti-perfd-client/client.cpp index 58d56c7..97864cd 100644 --- a/libqti-perfd-client/client.cpp +++ b/libqti-perfd-client/client.cpp @@ -1,10 +1,25 @@ +#define LOG_TAG "libqti-perfd-client" + #include +#include namespace android { extern "C" void perf_get_feedback() {} extern "C" void perf_hint() {} - extern "C" void perf_lock_acq() {} + extern "C" int perf_lock_acq(int handle, int duration, int arg3[], int arg4) { + ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", handle, duration, arg3[0], arg4); + if (handle > 0) + return handle; + + return 233; + } extern "C" void perf_lock_cmd() {} - extern "C" void perf_lock_rel() {} + extern "C" int perf_lock_rel(int handle) { + ALOGI("perf_lock_rel: handle: %d", handle); + if (handle > 0) + return handle; + + return 233; + } extern "C" void perf_lock_use_profile() {} }