Update portrait enrollment for UDFPS

Bug: 171353506

Test: No effect on existing devices

Change-Id: I701baf06bf3defde78af50eff5c0e01fafeb07cd
This commit is contained in:
Kevin Chyn
2020-11-30 17:16:00 -08:00
parent 61464f21a5
commit b07e2dbfd3
4 changed files with 223 additions and 5 deletions

View File

@@ -27,6 +27,7 @@ import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.media.AudioAttributes;
import android.os.Bundle;
import android.os.VibrationEffect;
@@ -51,6 +52,8 @@ import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupdesign.util.DescriptionStyler;
import java.util.List;
/**
* Activity which handles the actual enrolling for fingerprint.
*/
@@ -130,12 +133,29 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fingerprint_enroll_enrolling);
final FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
final List<FingerprintSensorPropertiesInternal> props =
fingerprintManager.getSensorPropertiesInternal();
final boolean canAssumeUdfps = props.size() == 1 && props.get(0).isAnyUdfpsType();
if (canAssumeUdfps) {
// Use a custom layout since animations, etc must be based off of the sensor's physical
// location.
setContentView(R.layout.udfps_enroll_enrolling);
final UdfpsEnrollLayout udfpsEnrollLayout = (UdfpsEnrollLayout) getLayoutInflater()
.inflate(R.layout.udfps_enroll_layout, null /* root */);
getLayout().addView(udfpsEnrollLayout);
} else {
setContentView(R.layout.fingerprint_enroll_enrolling);
}
setHeaderText(R.string.security_settings_fingerprint_enroll_repeat_title);
mStartMessage = (TextView) findViewById(R.id.sud_layout_description);
mRepeatMessage = (TextView) findViewById(R.id.repeat_message);
mErrorText = (TextView) findViewById(R.id.error_text);
mProgressBar = (ProgressBar) findViewById(R.id.fingerprint_progress_bar);
mStartMessage = findViewById(R.id.sud_layout_description);
mRepeatMessage = findViewById(R.id.repeat_message);
mErrorText = findViewById(R.id.error_text);
mProgressBar = findViewById(R.id.fingerprint_progress_bar);
mVibrator = getSystemService(Vibrator.class);
if (getLayout().shouldApplyPartnerHeavyThemeResource()) {