Allow skipping PIN setup screen

So that setup wizard can show PIN option by default.

Test: Added Robolectric and instrumentation tests
Bug: 38509560
Change-Id: Id72744dd444b9b026ca5f28f230bae3bec254b2f
(cherry picked from commit 0f897d79f6)
This commit is contained in:
Maurice Lam
2017-06-02 19:22:53 -07:00
parent ea46967c2e
commit 4c930fc2d5
10 changed files with 228 additions and 118 deletions

View File

@@ -84,6 +84,9 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mCancelButton.setText(R.string.skip_label);
boolean showOptionsButton = getActivity().getIntent().getBooleanExtra(
ChooseLockGenericFragment.EXTRA_SHOW_OPTIONS_BUTTON, false);
if (showOptionsButton) {
@@ -99,6 +102,12 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
case R.id.screen_lock_options:
launchChooseLockGeneric();
break;
case R.id.cancel_button:
SetupSkipDialog dialog = SetupSkipDialog.newInstance(
getActivity().getIntent()
.getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false));
dialog.show(getFragmentManager());
break;
default:
super.onClick(v);
}