Merge "Removed edge and tip hint for udfps" into sc-v2-dev

This commit is contained in:
Joshua Mccloskey
2022-01-20 00:33:04 +00:00
committed by Android (Google) Code Review
3 changed files with 28 additions and 0 deletions

View File

@@ -4652,6 +4652,8 @@
<item>0.75</item>
</string-array>
<bool name="config_udfpsSupportsNewUi" translatable="false">false</bool>
<!-- Messages that should not be shown to the user during face auth enrollment. This should be
used to hide messages that may be too chatty or messages that the user can't do much about.
Entries are defined in android.hardware.biometrics.face@1.0 types.hal -->

View File

@@ -2624,6 +2624,7 @@
<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_udfps_enroll_stage_thresholds" />
<java-symbol type="bool" name="config_udfpsSupportsNewUi" />
<java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
<java-symbol type="array" name="config_face_acquire_vendor_enroll_ignorelist" />

View File

@@ -97,6 +97,8 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
@NonNull private final ValueAnimator.AnimatorUpdateListener mEdgeHintWidthUpdateListener;
@NonNull private final Animator.AnimatorListener mEdgeHintPulseListener;
private boolean mShowingNewUdfpsEnroll = false;
UdfpsEnrollDrawable(@NonNull Context context) {
super(context);
@@ -211,6 +213,8 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
@Override
public void onAnimationRepeat(Animator animation) {}
};
mShowingNewUdfpsEnroll = context.getResources().getBoolean(
com.android.internal.R.bool.config_udfpsSupportsNewUi);
}
void setEnrollHelper(@NonNull UdfpsEnrollHelper helper) {
@@ -292,6 +296,10 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
}
mShouldShowTipHint = shouldShow;
if (mShowingNewUdfpsEnroll) {
return;
}
if (mTipHintWidthAnimator != null && mTipHintWidthAnimator.isRunning()) {
mTipHintWidthAnimator.cancel();
}
@@ -306,6 +314,7 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
} else {
mTipHintWidthAnimator.start();
}
}
private void updateEdgeHintVisibility() {
@@ -315,6 +324,10 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
}
mShouldShowEdgeHint = shouldShow;
if (mShowingNewUdfpsEnroll) {
return;
}
if (mEdgeHintWidthAnimator != null && mEdgeHintWidthAnimator.isRunning()) {
mEdgeHintWidthAnimator.cancel();
}
@@ -333,6 +346,10 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
}
private void startTipHintPulseAnimation() {
if (mShowingNewUdfpsEnroll) {
return;
}
mHandler.removeCallbacksAndMessages(null);
if (mTipHintAnimatorSet != null && mTipHintAnimatorSet.isRunning()) {
mTipHintAnimatorSet.cancel();
@@ -353,6 +370,10 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
}
private void startEdgeHintPulseAnimation() {
if (mShowingNewUdfpsEnroll) {
return;
}
mHandler.removeCallbacksAndMessages(null);
if (mEdgeHintAnimatorSet != null && mEdgeHintAnimatorSet.isRunning()) {
mEdgeHintAnimatorSet.cancel();
@@ -409,6 +430,10 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
mSensorOutlinePaint.setAlpha(mAlpha);
}
if (mShowingNewUdfpsEnroll) {
return;
}
// Draw the finger tip or edges hint.
if (isTipHintVisible() || isEdgeHintVisible()) {
canvas.save();