1/n Start adding Face settings (base, intro)

This change refactors common biometric settings code as well to minimize
duplicated code in areas such as:
    Preference Controller
    EnrollBase
    EnrollIntro

This change also updates ChooseLock to have Face + Pin/Pattern/Pass

Bug: 110589286

Test: Fingerprint settings/enrollment still works
Test: make -j56 RunSettingsRoboTests
Change-Id: Ie35406a01b85617423beece42683ac086e9bc4a7
This commit is contained in:
Kevin Chyn
2018-06-25 17:58:31 -07:00
parent 8700777839
commit 4882e875ae
31 changed files with 1094 additions and 269 deletions

View File

@@ -43,6 +43,7 @@ import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricSettings;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.password.ChooseLockGeneric;
import com.android.settings.password.ChooseLockSettingsHelper;
@@ -66,34 +67,10 @@ import androidx.preference.PreferenceViewHolder;
/**
* Settings screen for fingerprints
*/
public class FingerprintSettings extends SubSettings {
public class FingerprintSettings extends BiometricSettings {
private static final String TAG = "FingerprintSettings";
/**
* Used by the choose fingerprint wizard to indicate the wizard is
* finished, and each activity in the wizard should finish.
* <p>
* Previously, each activity in the wizard would finish itself after
* starting the next activity. However, this leads to broken 'Back'
* behavior. So, now an activity does not finish itself until it gets this
* result.
*/
protected static final int RESULT_FINISHED = RESULT_FIRST_USER;
/**
* Used by the enrolling screen during setup wizard to skip over setting up fingerprint, which
* will be useful if the user accidentally entered this flow.
*/
protected static final int RESULT_SKIP = RESULT_FIRST_USER + 1;
/**
* Like {@link #RESULT_FINISHED} except this one indicates enrollment failed because the
* device was left idle. This is used to clear the credential token to require the user to
* re-enter their pin/pattern/password before continuing.
*/
protected static final int RESULT_TIMEOUT = RESULT_FIRST_USER + 2;
private static final long LOCKOUT_DURATION = 30000; // time we have to wait for fp to reset, ms
public static final String ANNOTATION_URL = "url";