fixup! Simplify biometric detection

Change-Id: I2964746a5d648dc51328bac28e4fe5893341d1a6
This commit is contained in:
Oliver Scott
2023-12-27 11:38:53 -05:00
parent e54fdc16cc
commit 9b3f1afb50

View File

@@ -18,76 +18,17 @@
package org.lineageos.setupwizard;
import static org.lineageos.setupwizard.SetupWizardApp.ACTION_SETUP_BIOMETRIC;
import static org.lineageos.setupwizard.SetupWizardApp.EXTRA_DETAILS;
import static org.lineageos.setupwizard.SetupWizardApp.EXTRA_TITLE;
import static org.lineageos.setupwizard.SetupWizardApp.REQUEST_CODE_SETUP_BIOMETRIC;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import com.google.android.setupcompat.util.WizardManagerHelper;
import com.google.android.setupdesign.util.ThemeHelper;
import org.lineageos.setupwizard.util.SetupWizardUtils;
public class BiometricActivity extends SubBaseActivity {
public class BiometricActivity extends WrapperSubBaseActivity {
public static final String TAG = BiometricActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TextView setupBiometricSummary = (TextView) findViewById(
R.id.setup_biometric_summary);
final TextView setupAddBiometric = (TextView) findViewById(R.id.setup_add_biometric);
if (SetupWizardUtils.hasFace(this)) {
setupBiometricSummary.setText(getString(R.string.face_setup_summary));
setupAddBiometric.setText(R.string.face_setup_add_face);
} else {
setupBiometricSummary.setText(getString(R.string.fingerprint_setup_summary));
setupAddBiometric.setText(R.string.fingerprint_setup_add_fingerprint);
}
}
@Override
protected void onNextPressed() {
launchBiometricSetup();
}
@Override
protected void onStartSubactivity() {
setNextAllowed(true);
}
@Override
protected int getLayoutResId() {
return R.layout.setup_biometric;
}
@Override
protected int getTitleResId() {
if (SetupWizardUtils.hasFace(this)) {
return R.string.face_setup_title;
}
return R.string.fingerprint_setup_title;
}
@Override
protected int getIconResId() {
if (SetupWizardUtils.hasFace(this)) {
return R.drawable.ic_face;
}
return R.drawable.ic_fingerprint;
}
private void launchBiometricSetup() {
Intent intent = new Intent(ACTION_SETUP_BIOMETRIC);
intent.putExtra(EXTRA_TITLE,
getString(getTitleResId()));
intent.putExtra(EXTRA_DETAILS,
getString(R.string.settings_biometric_setup_details));
intent.putExtra(WizardManagerHelper.EXTRA_IS_SETUP_FLOW, true);
startSubactivity(intent, REQUEST_CODE_SETUP_BIOMETRIC);
}
}