From 40f6d7de2062d2213c9cd3b3853e52c42c16fa44 Mon Sep 17 00:00:00 2001 From: Simon1511 Date: Sat, 8 Jan 2022 14:30:27 +0100 Subject: [PATCH] sm7125: fod: set fod_rect per device Change-Id: Id4f421c81f64bc0119c38cbe72347240436b2b6c --- fod/FingerprintInscreen.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fod/FingerprintInscreen.cpp b/fod/FingerprintInscreen.cpp index 74340af..15bfc05 100644 --- a/fod/FingerprintInscreen.cpp +++ b/fod/FingerprintInscreen.cpp @@ -18,6 +18,7 @@ #include "FingerprintInscreen.h" #include +#include #include #include #include @@ -70,7 +71,17 @@ static hidl_vec stringToVec(const std::string& str) { FingerprintInscreen::FingerprintInscreen() { mSehBiometricsFingerprintService = ISehBiometricsFingerprint::getService(); - set(TSP_CMD_PATH, "set_fod_rect,421,2018,659,2256"); + + const std::string bootloader = android::base::GetProperty("ro.boot.bootloader", ""); + + if (bootloader.find("A525") != std::string::npos) { + set(TSP_CMD_PATH, "set_fod_rect,421,2018,659,2256"); + } else if (bootloader.find("A725") != std::string::npos) { + set(TSP_CMD_PATH, "set_fod_rect,426,2031,654,2259"); + } else { + LOG(ERROR) << "Device is not an A52 or A72, not setting set_fod_rect"; + } + set(TSP_CMD_PATH, "fod_enable,1,1,0"); }