OSDN Git Service

Nexus imprint setting is missing while adding corp account from SUW
authorSteven Ng <stevenckng@google.com>
Tue, 25 Oct 2016 16:23:30 +0000 (17:23 +0100)
committerSteven Ng <stevenckng@google.com>
Tue, 25 Oct 2016 20:01:23 +0000 (20:01 +0000)
+ 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

src/com/android/settings/ChooseLockGeneric.java

index 3b592d4..d109eb1 100644 (file)
@@ -299,7 +299,11 @@ public class ChooseLockGeneric extends SettingsActivity {
                 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.