eqs: fingerprint: use fod_hbm

Change-Id: Ib8df79139faa7d083459b4910c09c644203cca37
This commit is contained in:
Cosmin Tanislav
2023-01-12 13:05:39 +02:00
parent b6fee1e5d1
commit f04c402b21
2 changed files with 12 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
#include "BiometricsFingerprint.h" #include "BiometricsFingerprint.h"
#include <android-base/file.h>
#include <android-base/logging.h> #include <android-base/logging.h>
#include <fcntl.h> #include <fcntl.h>
#include <poll.h> #include <poll.h>
@@ -30,6 +31,8 @@
#define NOTIFY_FINGER_UP IMotFodEventType::FINGER_UP #define NOTIFY_FINGER_UP IMotFodEventType::FINGER_UP
#define NOTIFY_FINGER_DOWN IMotFodEventType::FINGER_DOWN #define NOTIFY_FINGER_DOWN IMotFodEventType::FINGER_DOWN
#define FOD_HBM_PATH "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_hbm"
namespace android { namespace android {
namespace hardware { namespace hardware {
namespace biometrics { namespace biometrics {
@@ -37,6 +40,10 @@ namespace fingerprint {
namespace V2_3 { namespace V2_3 {
namespace implementation { namespace implementation {
void setFodHbm(bool status) {
android::base::WriteStringToFile(status ? "1" : "0", FOD_HBM_PATH);
}
void BiometricsFingerprint::disableHighBrightFod() { void BiometricsFingerprint::disableHighBrightFod() {
std::lock_guard<std::mutex> lock(mSetHbmFodMutex); std::lock_guard<std::mutex> lock(mSetHbmFodMutex);
@@ -45,6 +52,7 @@ void BiometricsFingerprint::disableHighBrightFod() {
mMotoFingerprint->sendFodEvent(NOTIFY_FINGER_UP, {}, mMotoFingerprint->sendFodEvent(NOTIFY_FINGER_UP, {},
[](IMotFodEventResult, const hidl_vec<signed char> &) {}); [](IMotFodEventResult, const hidl_vec<signed char> &) {});
setFodHbm(false);
hbmFodEnabled = false; hbmFodEnabled = false;
} }
@@ -55,6 +63,7 @@ void BiometricsFingerprint::enableHighBrightFod() {
if (hbmFodEnabled) if (hbmFodEnabled)
return; return;
setFodHbm(true);
mMotoFingerprint->sendFodEvent(NOTIFY_FINGER_DOWN, {}, mMotoFingerprint->sendFodEvent(NOTIFY_FINGER_DOWN, {},
[](IMotFodEventResult, const hidl_vec<signed char> &) {}); [](IMotFodEventResult, const hidl_vec<signed char> &) {});

View File

@@ -1,3 +1,6 @@
on init
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_hbm
service fps_hal.eqs /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.3-service.eqs service fps_hal.eqs /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.3-service.eqs
# "class hal" causes a race condition on some devices due to files created # "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once # in /data. As a workaround, postpone startup until later in boot once