sm8150-common: fod: Set dim mode instead of HBM for fp enrollment

* That way we no longer have to turn HBM for
  the whole enroll process.

Change-Id: Ib0c48b117637381dbd7ab373bedd97dbc70dda28
Signed-off-by: Anirudh Gupta <anirudhgupta109@aosip.dev>
This commit is contained in:
Marko Man 2020-06-01 11:20:35 +02:00 committed by Omkar Chandorkar
parent 108f82974a
commit 440aeb5961
No known key found for this signature in database
GPG Key ID: 95A33FD984777F70
1 changed files with 4 additions and 8 deletions

View File

@ -34,9 +34,6 @@
#define OP_DISPLAY_NOTIFY_PRESS 9
#define OP_DISPLAY_SET_DIM 10
// This is not a typo by me. It's by OnePlus.
#define HBM_ENABLE_PATH "/sys/class/drm/card0-DSI-1/op_friginer_print_hbm"
namespace vendor {
namespace lineage {
namespace biometrics {
@ -74,7 +71,6 @@ Return<void> FingerprintInscreen::onStartEnroll() {
this->mIsEnrolling = true;
this->mVendorFpService->updateStatus(OP_DISABLE_FP_LONGPRESS);
this->mVendorFpService->updateStatus(OP_RESUME_FP_ENROLL);
set(HBM_ENABLE_PATH, 1);
return Void();
}
@ -82,12 +78,14 @@ Return<void> FingerprintInscreen::onStartEnroll() {
Return<void> FingerprintInscreen::onFinishEnroll() {
this->mIsEnrolling = false;
this->mVendorFpService->updateStatus(OP_FINISH_FP_ENROLL);
set(HBM_ENABLE_PATH, 0);
return Void();
}
Return<void> FingerprintInscreen::onPress() {
if (mIsEnrolling) {
this->mVendorDisplayService->setMode(OP_DISPLAY_SET_DIM, 1);
}
this->mVendorDisplayService->setMode(OP_DISPLAY_NOTIFY_PRESS, 1);
return Void();
@ -145,10 +143,8 @@ Return<bool> FingerprintInscreen::handleAcquired(int32_t acquiredInfo, int32_t v
Return<bool> FingerprintInscreen::handleError(int32_t error, int32_t vendorCode) {
switch (error) {
case FINGERPRINT_ERROR_CANCELED:
// Turn HBM off after canceled fingerprint enrollment
if (this->mIsEnrolling && vendorCode == 0) {
if (vendorCode == 0) {
this->mIsEnrolling = false;
set(HBM_ENABLE_PATH, 0);
}
return false;
case FINGERPRINT_ERROR_VENDOR: