Tweaks to integrate BiometricEnrollActivity to SUW

- Default backup screen lock type to PIN when in SUW
- Propagate the result codes in BiometricEnrollIntroduction, so that
  when the user hits back, SUW will get RESULT_CANCELED
- Follow-up change that was missed in ag/6664364 to not start activity
  when neither fingerprint nor face is available

Test: Manual
Bug: 120797018
Change-Id: I6d4f662928451fb86f301ddb5c6586622c7e6cf7
This commit is contained in:
Maurice Lam
2019-03-08 11:00:23 -08:00
parent a035165e97
commit 1a105fea94
2 changed files with 20 additions and 12 deletions

View File

@@ -41,19 +41,19 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
super.onCreate(savedInstanceState);
final PackageManager pm = getApplicationContext().getPackageManager();
Intent intent;
Intent intent = null;
// This logic may have to be modified on devices with multiple biometrics.
if (pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
intent = getFingerprintEnrollIntent();
} else if (pm.hasSystemFeature(PackageManager.FEATURE_FACE)) {
intent = getFaceEnrollIntent();
} else {
intent = new Intent();
}
intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
startActivity(intent);
if (intent != null) {
intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
startActivity(intent);
}
finish();
}