diff --git a/udfps/UdfpsHandler.cpp b/udfps/UdfpsHandler.cpp index afe3d6d..16e5d9c 100644 --- a/udfps/UdfpsHandler.cpp +++ b/udfps/UdfpsHandler.cpp @@ -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();