Merge "Add device-specific illumination transition time" into sc-dev

This commit is contained in:
Ilya Matyukhin
2021-06-18 19:52:53 +00:00
committed by Android (Google) Code Review
3 changed files with 10 additions and 3 deletions

View File

@@ -4521,6 +4521,9 @@
-->
</integer-array>
<!-- How long it takes for the HW to start illuminating after the illumination is requested. -->
<integer name="config_udfps_illumination_transition_ms">50</integer>
<!-- Indicates whether device has a power button fingerprint sensor. -->
<bool name="config_is_powerbutton_fps" translatable="false" >false</bool>

View File

@@ -2590,6 +2590,7 @@
<java-symbol type="array" name="config_biometric_sensors" />
<java-symbol type="bool" name="allow_test_udfps" />
<java-symbol type="array" name="config_udfps_sensor_props" />
<java-symbol type="integer" name="config_udfps_illumination_transition_ms" />
<java-symbol type="bool" name="config_is_powerbutton_fps" />
<java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />

View File

@@ -55,6 +55,7 @@ public class UdfpsSurfaceView extends SurfaceView implements UdfpsIlluminator {
@NonNull private final SurfaceHolder mHolder;
@NonNull private final Paint mSensorPaint;
@NonNull private final SimpleDrawable mIlluminationDotDrawable;
private final int mOnIlluminatedDelayMs;
private final @HbmType int mHbmType;
@NonNull private RectF mSensorRect;
@@ -82,6 +83,9 @@ public class UdfpsSurfaceView extends SurfaceView implements UdfpsIlluminator {
canvas.drawOval(mSensorRect, mSensorPaint);
};
mOnIlluminatedDelayMs = mContext.getResources().getInteger(
com.android.internal.R.integer.config_udfps_illumination_transition_ms);
if (Build.IS_ENG || Build.IS_USERDEBUG) {
mHbmType = Settings.Secure.getIntForUser(mContext.getContentResolver(),
SETTING_HBM_TYPE, DEFAULT_HBM_TYPE, UserHandle.USER_CURRENT);
@@ -107,9 +111,8 @@ public class UdfpsSurfaceView extends SurfaceView implements UdfpsIlluminator {
}
if (onIlluminatedRunnable != null) {
// No framework API can reliably tell when a frame reaches the panel. A timeout
// is the safest solution. The frame should be displayed within 3 refresh
// cycles, which on a 60 Hz panel equates to 50 milliseconds.
postDelayed(onIlluminatedRunnable, 50 /* delayMillis */);
// is the safest solution.
postDelayed(onIlluminatedRunnable, mOnIlluminatedDelayMs);
} else {
Log.w(TAG, "startIllumination | onIlluminatedRunnable is null");
}