Merge "Add device-specific illumination transition time" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ea80426e73
@@ -4521,6 +4521,9 @@
|
|||||||
-->
|
-->
|
||||||
</integer-array>
|
</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. -->
|
<!-- Indicates whether device has a power button fingerprint sensor. -->
|
||||||
<bool name="config_is_powerbutton_fps" translatable="false" >false</bool>
|
<bool name="config_is_powerbutton_fps" translatable="false" >false</bool>
|
||||||
|
|
||||||
|
|||||||
@@ -2590,6 +2590,7 @@
|
|||||||
<java-symbol type="array" name="config_biometric_sensors" />
|
<java-symbol type="array" name="config_biometric_sensors" />
|
||||||
<java-symbol type="bool" name="allow_test_udfps" />
|
<java-symbol type="bool" name="allow_test_udfps" />
|
||||||
<java-symbol type="array" name="config_udfps_sensor_props" />
|
<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="bool" name="config_is_powerbutton_fps" />
|
||||||
|
|
||||||
<java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
|
<java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class UdfpsSurfaceView extends SurfaceView implements UdfpsIlluminator {
|
|||||||
@NonNull private final SurfaceHolder mHolder;
|
@NonNull private final SurfaceHolder mHolder;
|
||||||
@NonNull private final Paint mSensorPaint;
|
@NonNull private final Paint mSensorPaint;
|
||||||
@NonNull private final SimpleDrawable mIlluminationDotDrawable;
|
@NonNull private final SimpleDrawable mIlluminationDotDrawable;
|
||||||
|
private final int mOnIlluminatedDelayMs;
|
||||||
private final @HbmType int mHbmType;
|
private final @HbmType int mHbmType;
|
||||||
|
|
||||||
@NonNull private RectF mSensorRect;
|
@NonNull private RectF mSensorRect;
|
||||||
@@ -82,6 +83,9 @@ public class UdfpsSurfaceView extends SurfaceView implements UdfpsIlluminator {
|
|||||||
canvas.drawOval(mSensorRect, mSensorPaint);
|
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) {
|
if (Build.IS_ENG || Build.IS_USERDEBUG) {
|
||||||
mHbmType = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
mHbmType = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||||
SETTING_HBM_TYPE, DEFAULT_HBM_TYPE, UserHandle.USER_CURRENT);
|
SETTING_HBM_TYPE, DEFAULT_HBM_TYPE, UserHandle.USER_CURRENT);
|
||||||
@@ -107,9 +111,8 @@ public class UdfpsSurfaceView extends SurfaceView implements UdfpsIlluminator {
|
|||||||
}
|
}
|
||||||
if (onIlluminatedRunnable != null) {
|
if (onIlluminatedRunnable != null) {
|
||||||
// No framework API can reliably tell when a frame reaches the panel. A timeout
|
// 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
|
// is the safest solution.
|
||||||
// cycles, which on a 60 Hz panel equates to 50 milliseconds.
|
postDelayed(onIlluminatedRunnable, mOnIlluminatedDelayMs);
|
||||||
postDelayed(onIlluminatedRunnable, 50 /* delayMillis */);
|
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "startIllumination | onIlluminatedRunnable is null");
|
Log.w(TAG, "startIllumination | onIlluminatedRunnable is null");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user