diff options
| author | 2021-06-18 19:52:53 +0000 | |
|---|---|---|
| committer | 2021-06-18 19:52:53 +0000 | |
| commit | ea80426e73309215c92eb94bcd0bcd8958719aff (patch) | |
| tree | 6967b1f04c44b7f5c1b1502724047cbd2f5490a1 | |
| parent | b82d3b0b76c8a118a85b825c8b800697e62cfa23 (diff) | |
| parent | 8c1d1169d8145dce1f1d8154d75f63e7889520a6 (diff) | |
Merge "Add device-specific illumination transition time" into sc-dev
| -rw-r--r-- | core/res/res/values/config.xml | 3 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 1 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java | 9 |
3 files changed, 10 insertions, 3 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index ee33d48768c5..f8b9c6b83ada 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -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> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7d685a202538..7c518983fb83 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -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" /> diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java index 6a6f57a64be6..f8be35ab6cd8 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java @@ -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"); } |