Add missing 'pin' screen lock option
bug: 62206837 Test: Manual verified; Existing tests pass Change-Id: I65985427cb012668ee23bedaf7253bec7c83fe75
This commit is contained in:
@@ -46,15 +46,13 @@ public class ChooseLockTypeDialogFragment extends InstrumentedDialogFragment
|
||||
implements OnClickListener {
|
||||
|
||||
private static final String ARG_USER_ID = "userId";
|
||||
private static final String ARG_EXCLUDE_LOCK = "excludeLock";
|
||||
|
||||
private ScreenLockAdapter mAdapter;
|
||||
private ChooseLockGenericController mController;
|
||||
|
||||
public static ChooseLockTypeDialogFragment newInstance(int userId, String excludeLock) {
|
||||
public static ChooseLockTypeDialogFragment newInstance(int userId) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(ARG_USER_ID, userId);
|
||||
args.putString(ARG_EXCLUDE_LOCK, excludeLock);
|
||||
ChooseLockTypeDialogFragment fragment = new ChooseLockTypeDialogFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
@@ -96,10 +94,6 @@ public class ChooseLockTypeDialogFragment extends InstrumentedDialogFragment
|
||||
mController.getVisibleScreenLockTypes(
|
||||
DevicePolicyManager.PASSWORD_QUALITY_SOMETHING,
|
||||
false /* includeDisabled */);
|
||||
String excludeLockName = getArguments().getString(ARG_EXCLUDE_LOCK);
|
||||
if (excludeLockName != null) {
|
||||
locks.remove(ScreenLockType.valueOf(excludeLockName));
|
||||
}
|
||||
mAdapter = new ScreenLockAdapter(context, locks, mController);
|
||||
builder.setAdapter(mAdapter, this);
|
||||
builder.setTitle(R.string.setup_lock_settings_options_dialog_title);
|
||||
|
@@ -114,9 +114,7 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
|
||||
}
|
||||
|
||||
private void launchChooseLockGeneric() {
|
||||
ScreenLockType currentLock = mIsAlphaMode
|
||||
? ScreenLockType.PASSWORD : ScreenLockType.PIN;
|
||||
ChooseLockTypeDialogFragment.newInstance(mUserId, currentLock.toString())
|
||||
ChooseLockTypeDialogFragment.newInstance(mUserId)
|
||||
.show(getChildFragmentManager(), null);
|
||||
}
|
||||
|
||||
@@ -130,6 +128,12 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
|
||||
|
||||
@Override
|
||||
public void onLockTypeSelected(ScreenLockType lock) {
|
||||
ScreenLockType currentLockType = mIsAlphaMode ?
|
||||
ScreenLockType.PASSWORD : ScreenLockType.PIN;
|
||||
if (currentLockType.equals(lock)) {
|
||||
// ignore same lock type.
|
||||
return;
|
||||
}
|
||||
Intent activityIntent = getActivity().getIntent();
|
||||
Intent intent = new Intent(getContext(), SetupChooseLockGeneric.class);
|
||||
|
||||
|
Reference in New Issue
Block a user