sm7125: fod: Set brightness per FP press

*Brightness should be boosted only when fingerprint is pressed to correctly light up the screen

*Return 0 in getDimAmount since we dont want to dim the screen

*Set brightness to 331 instead of 319 since this is default on A52 stock

Change-Id: Ieccc170f14e75f3ec998bb5d4a10b8dc49085cc7
fourteen-wip
Simon1511 3 years ago
parent 7e9c446d2e
commit 601e48c3db
  1. 6
      fod/FingerprintInscreen.cpp

@ -83,8 +83,6 @@ FingerprintInscreen::FingerprintInscreen() {
LOG(ERROR) << "Device is not an A52 or A72, not setting set_fod_rect"; LOG(ERROR) << "Device is not an A52 or A72, not setting set_fod_rect";
} }
mPreviousBrightness = get<std::string>(BRIGHTNESS_PATH, "");
set(BRIGHTNESS_PATH, "319");
set(TSP_CMD_PATH, "fod_enable,1,1,0"); set(TSP_CMD_PATH, "fod_enable,1,1,0");
} }
@ -101,6 +99,8 @@ Return<void> FingerprintInscreen::onFinishEnroll() {
} }
Return<void> FingerprintInscreen::onPress() { Return<void> FingerprintInscreen::onPress() {
mPreviousBrightness = get<std::string>(BRIGHTNESS_PATH, "");
set(BRIGHTNESS_PATH, "331");
mSehBiometricsFingerprintService->sehRequest(SEM_FINGER_STATE, mSehBiometricsFingerprintService->sehRequest(SEM_FINGER_STATE,
SEM_PARAM_PRESSED, stringToVec(SEM_AOSP_FQNAME), FingerprintInscreen::requestResult); SEM_PARAM_PRESSED, stringToVec(SEM_AOSP_FQNAME), FingerprintInscreen::requestResult);
return Void(); return Void();
@ -164,7 +164,7 @@ Return<void> FingerprintInscreen::setLongPressEnabled(bool) {
} }
Return<int32_t> FingerprintInscreen::getDimAmount(int32_t cur_brightness) { Return<int32_t> FingerprintInscreen::getDimAmount(int32_t cur_brightness) {
return (int32_t)(255 + ( -40.9291 * pow((double) cur_brightness, 0.3))); return 0;
} }
Return<bool> FingerprintInscreen::shouldBoostBrightness() { Return<bool> FingerprintInscreen::shouldBoostBrightness() {

Loading…
Cancel
Save