From 95126a384e6e772d12eaebac3fd7825e42844406 Mon Sep 17 00:00:00 2001 From: Demon000 Date: Sat, 23 May 2020 12:35:10 +0200 Subject: [PATCH] davinci: fod: Switch to in-kernel handling of changes Change-Id: I242a57b42bb455835bbc0777878a93bca6b986e7 --- fod/FingerprintInscreen.cpp | 27 +------------------ ...ingerprint.inscreen@1.0-service.davinci.rc | 3 --- sepolicy/vendor/file_contexts | 1 - 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/fod/FingerprintInscreen.cpp b/fod/FingerprintInscreen.cpp index e5be291..cc3e1f2 100644 --- a/fod/FingerprintInscreen.cpp +++ b/fod/FingerprintInscreen.cpp @@ -28,10 +28,6 @@ #define PARAM_NIT_FOD 1 #define PARAM_NIT_NONE 0 -#define FOD_HBM_PATH "/sys/devices/platform/soc/soc:qcom,dsi-display/fod_hbm" -#define FOD_HBM_ON 1 -#define FOD_HBM_OFF 0 - #define FOD_STATUS_PATH "/sys/devices/virtual/touch/tp_dev/fod_status" #define FOD_STATUS_ON 1 #define FOD_STATUS_OFF 0 @@ -40,18 +36,8 @@ #define FOD_SENSOR_Y 1931 #define FOD_SENSOR_SIZE 190 -#define BRIGHTNESS_PATH "/sys/class/backlight/panel0-backlight/brightness" - namespace { -template -static T get(const std::string& path, const T& def) { - std::ifstream file(path); - T result; - file >> result; - return file.fail() ? def : result; -} - template static void set(const std::string& path, const T& value) { std::ofstream file(path); @@ -93,13 +79,11 @@ Return FingerprintInscreen::onFinishEnroll() { } Return FingerprintInscreen::onPress() { - set(FOD_HBM_PATH, FOD_HBM_ON); xiaomiFingerprintService->extCmd(COMMAND_NIT, PARAM_NIT_FOD); return Void(); } Return FingerprintInscreen::onRelease() { - set(FOD_HBM_PATH, FOD_HBM_OFF); xiaomiFingerprintService->extCmd(COMMAND_NIT, PARAM_NIT_NONE); return Void(); } @@ -151,16 +135,7 @@ Return FingerprintInscreen::setLongPressEnabled(bool) { } Return FingerprintInscreen::getDimAmount(int32_t /* brightness */) { - int realBrightness = get(BRIGHTNESS_PATH, 0); - float alpha; - - if (realBrightness > 500) { - alpha = 1.0 - pow(realBrightness / 2047.0 * 430.0 / 600.0, 0.455); - } else { - alpha = 1.0 - pow(realBrightness / 1680.0, 0.455); - } - - return 255 * alpha; + return 0; } Return FingerprintInscreen::shouldBoostBrightness() { diff --git a/fod/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.davinci.rc b/fod/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.davinci.rc index fd31135..fc9b733 100644 --- a/fod/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.davinci.rc +++ b/fod/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.davinci.rc @@ -1,8 +1,5 @@ on boot - chown system system /sys/devices/platform/soc/soc:qcom,dsi-display/fod_hbm chown system system /sys/devices/virtual/touch/tp_dev/fod_status - - chmod 0644 /sys/devices/platform/soc/soc:qcom,dsi-display/fod_hbm chmod 0644 /sys/devices/virtual/touch/tp_dev/fod_status service vendor.fingerprint-inscreen-1-0 /vendor/bin/hw/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.davinci diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 00f4db5..9aa9615 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -9,7 +9,6 @@ /data/vendor/goodix(/.*)? u:object_r:fingerprint_data_file:s0 # FOD -/sys/devices/platform/soc/soc:qcom,dsi-display/fod_hbm u:object_r:sysfs_fod:s0 /sys/devices/virtual/touch/tp_dev/fod_status u:object_r:sysfs_fod:s0 # HALs