Default setup wizard to use PIN

- Added "Screen lock options" button in PIN screen, controlled by
  extra EXTRA_SHOW_OPTIONS_BUTTON, which will create a dialog to ask
  the user to choose another screen lock type.
- Extracted ScreenLockType enum and ChooseLockGenericController that
  can be shared by ChooseLockGeneric and the dialog
  ChooseLockTypeDialogFragment.
- The intent extra EXTRA_SHOW_OPTIONS_BUTTON will be set if
  ChooseLockGeneric screen starts ChooseLockPassword /
  ChooseLockPattern without asking the user. (Although the extra is
  ignored by ChooseLockPattern currently)
- Fix layout alignment for the password entry field to remove the
  extra 4dp padding on the sides.

Test: cd tests/robotests && mma
Bug: 35442933
Bug: 38002299
Change-Id: I877fbe08a0c05bb97175e1cbf0260ea6dbda22e2
This commit is contained in:
Maurice Lam
2017-04-27 18:54:33 -07:00
parent 9e8a182c31
commit edb3944984
17 changed files with 1117 additions and 183 deletions

View File

@@ -111,20 +111,16 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != RESULT_CANCELED) {
if (data == null) {
data = new Intent();
}
// Add the password quality extra to the intent data that will be sent back for
// Setup Wizard.
LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity());
data.putExtra(EXTRA_PASSWORD_QUALITY,
lockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId()));
super.onActivityResult(requestCode, resultCode, data);
if (data == null) {
data = new Intent();
}
// If the started activity was cancelled (e.g. the user presses back), then this
// activity will be resumed to foreground.
// Add the password quality extra to the intent data that will be sent back for
// Setup Wizard.
LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity());
data.putExtra(EXTRA_PASSWORD_QUALITY,
lockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId()));
super.onActivityResult(requestCode, resultCode, data);
}
@Override