Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea80426e authored by Ilya Matyukhin's avatar Ilya Matyukhin Committed by Android (Google) Code Review
Browse files

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

parents b82d3b0b 8c1d1169
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>

+1 −0
Original line number Diff line number Diff line
@@ -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" />
+6 −3
Original line number Diff line number Diff line
@@ -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");
                }