sm8450-common: udfps: Revert usage of low brightness
Unfortunately, on devices like cupid the recognition is significantly worse with this. Change-Id: I174e3869e86cb19f69e748372941d5065a54b7a7
This commit is contained in:
parent
e651d4133a
commit
fe921f1062
1 changed files with 2 additions and 18 deletions
|
@ -134,28 +134,12 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
|||
mDevice->extCmd(mDevice, COMMAND_FOD_PRESS_STATUS,
|
||||
pressed ? PARAM_FOD_PRESSED : PARAM_FOD_RELEASED);
|
||||
|
||||
// Get brightness
|
||||
struct disp_brightness_req brightness_req;
|
||||
int brightness = LOW_BRIGHTNESS_THRESHHOLD;
|
||||
brightness_req.base.flag = 0;
|
||||
brightness_req.base.disp_id = MI_DISP_PRIMARY;
|
||||
rc = ioctl(disp_fd_.get(), MI_DISP_IOCTL_GET_BRIGHTNESS, &brightness_req);
|
||||
if (rc) {
|
||||
LOG(ERROR) << "failed to get brightness, err: " << rc;
|
||||
} else if (brightness_req.brightness > 0) {
|
||||
brightness = brightness_req.brightness;
|
||||
}
|
||||
LOG(DEBUG) << "brightness is: " << (int)brightness_req.brightness;
|
||||
bool requestLowBrightness = !enrolling && brightness < LOW_BRIGHTNESS_THRESHHOLD;
|
||||
|
||||
// Request HBM
|
||||
disp_local_hbm_req req;
|
||||
req.base.flag = 0;
|
||||
req.base.disp_id = MI_DISP_PRIMARY;
|
||||
req.local_hbm_value =
|
||||
pressed ? (requestLowBrightness ? LHBM_TARGET_BRIGHTNESS_WHITE_110NIT
|
||||
: LHBM_TARGET_BRIGHTNESS_WHITE_1000NIT)
|
||||
: LHBM_TARGET_BRIGHTNESS_OFF_FINGER_UP;
|
||||
req.local_hbm_value = pressed ? LHBM_TARGET_BRIGHTNESS_WHITE_1000NIT
|
||||
: LHBM_TARGET_BRIGHTNESS_OFF_FINGER_UP;
|
||||
ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &req);
|
||||
}
|
||||
}).detach();
|
||||
|
|
Loading…
Reference in a new issue