Fingerprint Introduction FragmentActivity
Introducing MVVM architecture & fragments to biometric settings. Here, we modify the first page of FingerprintEnrollIntroduction to use new MVVM with Fragment architecture. And with this new architecture, unit test and screen order will be easier to be written or changed. Bug: 236072782 Test: atest FingerprintEnrollmentViewModelTest AutoCredentialViewModelTest FingerprintEnrollIntroViewModelTest FingerprintRepositoryTest Change-Id: Icf12c91625db86c2c99081a0108203e607e77f74
This commit is contained in:
@@ -25,6 +25,7 @@ import android.content.IntentSender;
|
||||
import android.hardware.biometrics.SensorProperties;
|
||||
import android.hardware.face.FaceManager;
|
||||
import android.hardware.face.FaceSensorPropertiesInternal;
|
||||
import android.os.Bundle;
|
||||
import android.os.storage.StorageManager;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
@@ -145,6 +146,31 @@ public class BiometricUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context caller's context
|
||||
* @param isSuw if it is running in setup wizard flows
|
||||
* @param suwExtras setup wizard extras for new intent
|
||||
* @return Intent for starting ChooseLock*
|
||||
*/
|
||||
public static Intent getChooseLockIntent(@NonNull Context context,
|
||||
boolean isSuw, @NonNull Bundle suwExtras) {
|
||||
if (isSuw) {
|
||||
// Default to PIN lock in setup wizard
|
||||
Intent intent = new Intent(context, SetupChooseLockGeneric.class);
|
||||
if (StorageManager.isFileEncrypted()) {
|
||||
intent.putExtra(
|
||||
LockPatternUtils.PASSWORD_TYPE_KEY,
|
||||
DevicePolicyManager.PASSWORD_QUALITY_NUMERIC);
|
||||
intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment
|
||||
.EXTRA_SHOW_OPTIONS_BUTTON, true);
|
||||
}
|
||||
intent.putExtras(suwExtras);
|
||||
return intent;
|
||||
} else {
|
||||
return new Intent(context, ChooseLockGeneric.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context caller's context
|
||||
* @param activityIntent The intent that started the caller's activity
|
||||
|
Reference in New Issue
Block a user