diff options
author | Lucky Zhang <luckyzh@google.com> | 2014-12-05 15:00:20 -0800 |
---|---|---|
committer | Lucky Zhang <luckyzh@google.com> | 2014-12-05 18:50:55 -0800 |
commit | df8566a9a1eb69ee19376457fe0ee8ad39774790 (patch) | |
tree | 61d35d94052914796310658da34f0c9c733b1485 /src/com/android/settings/ChooseLockGeneric.java | |
parent | 7dca460af7a6a9d683ea398c6eb2e3f784aa6900 (diff) | |
download | packages_apps_Settings-df8566a9a1eb69ee19376457fe0ee8ad39774790.zip packages_apps_Settings-df8566a9a1eb69ee19376457fe0ee8ad39774790.tar.gz packages_apps_Settings-df8566a9a1eb69ee19376457fe0ee8ad39774790.tar.bz2 |
[FRP] Remove None and Swipe from screen lock options
Removed "None" and "Swipe" from screen lock options in the choosing
lock screen during setup wizard, because at this step, the user has
already chosen to pick a screen lock, hence it's unnecessory to show
"none" and "swipe".
Implemented this by overriding the DisableUnusablePreferences in
SetupChooseLockGenericFragment to disable the insecure lock methods
and adding a flag to hide disabled methods for setup wizard.
Bug: 18631416
Change-Id: I3feccf591da25bd6eadcc03c75b28cfc1d069db7
Diffstat (limited to 'src/com/android/settings/ChooseLockGeneric.java')
-rw-r--r-- | src/com/android/settings/ChooseLockGeneric.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java index f64a9df..b289e7a 100644 --- a/src/com/android/settings/ChooseLockGeneric.java +++ b/src/com/android/settings/ChooseLockGeneric.java @@ -288,14 +288,30 @@ public class ChooseLockGeneric extends SettingsActivity { } /*** + * Disables preferences that are less secure than required quality. The actual + * implementation is in disableUnusablePreferenceImpl. + * + * @param quality the requested quality. + * @param allowBiometric whether to allow biometic screen lock. + */ + protected void disableUnusablePreferences(final int quality, + MutableBoolean allowBiometric) { + disableUnusablePreferencesImpl(quality, allowBiometric, false /* hideDisabled */); + } + + /*** * Disables preferences that are less secure than required quality. * * @param quality the requested quality. + * @param allowBiometric whether to allow biometic screen lock. + * @param hideDisabled whether to hide disable screen lock options. */ - private void disableUnusablePreferences(final int quality, MutableBoolean allowBiometric) { + protected void disableUnusablePreferencesImpl(final int quality, + MutableBoolean allowBiometric, boolean hideDisabled) { final PreferenceScreen entries = getPreferenceScreen(); - final boolean onlyShowFallback = getActivity().getIntent() - .getBooleanExtra(LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false); + final Intent intent = getActivity().getIntent(); + final boolean onlyShowFallback = intent.getBooleanExtra( + LockPatternUtils.LOCKSCREEN_BIOMETRIC_WEAK_FALLBACK, false); final boolean weakBiometricAvailable = mChooseLockSettingsHelper.utils().isBiometricWeakInstalled(); @@ -326,6 +342,9 @@ public class ChooseLockGeneric extends SettingsActivity { } else if (KEY_UNLOCK_SET_PASSWORD.equals(key)) { enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_COMPLEX; } + if (hideDisabled) { + visible = visible && enabled; + } if (!visible || (onlyShowFallback && !allowedForFallback(key))) { entries.removePreference(pref); } else if (!enabled) { |