Nexus imprint setting is missing while adding corp account from SUW
+ This is caused by the encryption interstitial result code not handled
in ChooseLockGeneric. Change the request code of launching encryption
interstitial screen to CHOOSE_LOCK_BEFORE_FINGERPRINT_REQUEST if it
is set new password flow.
Testing
Test: See below
1) Auto
make RunSettingsRoboTests
2) Manual
On a device (Nexus 5x) that shows encryption interstital screen and
supports fingerprint.
1) Nexus imprint flow (regression test)
Fingerprint can be enrolled with the following flow.
Settings > Security > Nexus Imprint > FingerprintEnrollIntroduction
> ChooseLockGeneric (Unlock selection) > Encryption Interstitial
> Password setup > Notification Interstitial
> Find sensor and fingerprint enrollment
2) Set new password test
i) $ adb shell am start -a android.app.action.SET_NEW_PASSWORD
ii) Click Nexus Imprint + Pattern.
iii) Choose "Require pattern to start device"
iv) Set a pattern lock.
v) Choose any of the notification behavior.
vi) Can enroll a fingerprint.
Bug: 32382952
Change-Id: Ie66ffca2e8c3cc46b5e8b619bd35986e4f41d5ab
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 3b592d4..d109eb1 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -299,7 +299,11 @@
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT,
mForFingerprint);
intent.putExtra(EXTRA_HIDE_DRAWER, mHideDrawer);
- startActivityForResult(intent, ENABLE_ENCRYPTION_REQUEST);
+ startActivityForResult(
+ intent,
+ mIsSetNewPassword && mHasChallenge
+ ? CHOOSE_LOCK_BEFORE_FINGERPRINT_REQUEST
+ : ENABLE_ENCRYPTION_REQUEST);
} else {
if (mForChangeCredRequiredForBoot) {
// Welp, couldn't change it. Oh well.