diff options
author | Jim Miller <jaggies@google.com> | 2015-03-11 20:17:39 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2015-03-12 14:13:45 -0700 |
commit | 3fb2fb8ac3717b32577c9d65b2e84f1839f4b349 (patch) | |
tree | 10a5758f1c7672c86876b1948db7407dde32d193 | |
parent | fe08c383665dcdd43c2313ce5d54874d1f92aebc (diff) | |
download | packages_apps_Settings-3fb2fb8ac3717b32577c9d65b2e84f1839f4b349.tar.gz packages_apps_Settings-3fb2fb8ac3717b32577c9d65b2e84f1839f4b349.tar.bz2 packages_apps_Settings-3fb2fb8ac3717b32577c9d65b2e84f1839f4b349.zip |
Add flag to hide disabled keyguard options.
Normally keyguard options are disabled by things like credential
storage and device admins, so we show the reason in ChooseLockGeneric.
However, in the case of fingerprint we want to limit the scope
to just those options that have security (pin,password,pattern).
Bug 19592835
Change-Id: I6832ff692bad538adeec2f2575fca4f8f04f40cf
-rw-r--r-- | src/com/android/settings/ChooseLockGeneric.java | 22 | ||||
-rw-r--r-- | src/com/android/settings/FingerprintEnroll.java | 1 | ||||
-rw-r--r-- | src/com/android/settings/SetupChooseLockGeneric.java | 2 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java index 216b1cab0..af793f784 100644 --- a/src/com/android/settings/ChooseLockGeneric.java +++ b/src/com/android/settings/ChooseLockGeneric.java @@ -74,26 +74,24 @@ public class ChooseLockGeneric extends SettingsActivity { } public static class ChooseLockGenericFragment extends SettingsPreferenceFragment { + private static final String TAG = "ChooseLockGenericFragment"; private static final int MIN_PASSWORD_LENGTH = 4; - private static final String KEY_UNLOCK_BACKUP_INFO = "unlock_backup_info"; private static final String KEY_UNLOCK_SET_OFF = "unlock_set_off"; private static final String KEY_UNLOCK_SET_NONE = "unlock_set_none"; private static final String KEY_UNLOCK_SET_PIN = "unlock_set_pin"; private static final String KEY_UNLOCK_SET_PASSWORD = "unlock_set_password"; private static final String KEY_UNLOCK_SET_PATTERN = "unlock_set_pattern"; - private static final int CONFIRM_EXISTING_REQUEST = 100; - private static final int ENABLE_ENCRYPTION_REQUEST = 102; - private static final int CHOOSE_LOCK_REQUEST = 103; private static final String PASSWORD_CONFIRMED = "password_confirmed"; - private static final String WAITING_FOR_CONFIRMATION = "waiting_for_confirmation"; - private static final String TAG = "ChooseLockGenericFragment"; public static final String MINIMUM_QUALITY_KEY = "minimum_quality"; + public static final String HIDE_DISABLED_PREFS = "hide_disabled_prefs"; public static final String ENCRYPT_REQUESTED_QUALITY = "encrypt_requested_quality"; public static final String ENCRYPT_REQUESTED_DISABLED = "encrypt_requested_disabled"; public static final String TAG_FRP_WARNING_DIALOG = "frp_warning_dialog"; - private static final boolean ALWAY_SHOW_TUTORIAL = true; + private static final int CONFIRM_EXISTING_REQUEST = 100; + private static final int ENABLE_ENCRYPTION_REQUEST = 101; + private static final int CHOOSE_LOCK_REQUEST = 102; private ChooseLockSettingsHelper mChooseLockSettingsHelper; private DevicePolicyManager mDPM; @@ -224,12 +222,14 @@ public class ChooseLockGeneric extends SettingsActivity { // If caller didn't specify password quality, show UI and allow the user to choose. quality = intent.getIntExtra(MINIMUM_QUALITY_KEY, -1); quality = upgradeQuality(quality); + final boolean hideDisabledPrefs = intent.getBooleanExtra( + HIDE_DISABLED_PREFS, false); final PreferenceScreen prefScreen = getPreferenceScreen(); if (prefScreen != null) { prefScreen.removeAll(); } addPreferencesFromResource(R.xml.security_settings_picker); - disableUnusablePreferences(quality); + disableUnusablePreferences(quality, hideDisabledPrefs); updatePreferenceSummaryIfNeeded(); } else { updateUnlockMethodAndFinish(quality, false); @@ -266,9 +266,11 @@ public class ChooseLockGeneric extends SettingsActivity { * implementation is in disableUnusablePreferenceImpl. * * @param quality the requested quality. + * @param hideDisabledPrefs if false preferences show why they were disabled; otherwise + * they're not shown at all. */ - protected void disableUnusablePreferences(final int quality) { - disableUnusablePreferencesImpl(quality, false /* hideDisabled */); + protected void disableUnusablePreferences(final int quality, boolean hideDisabledPrefs) { + disableUnusablePreferencesImpl(quality, hideDisabledPrefs); } /*** diff --git a/src/com/android/settings/FingerprintEnroll.java b/src/com/android/settings/FingerprintEnroll.java index f7ca36b79..865fcdc42 100644 --- a/src/com/android/settings/FingerprintEnroll.java +++ b/src/com/android/settings/FingerprintEnroll.java @@ -465,6 +465,7 @@ public class FingerprintEnroll extends SettingsActivity { intent.setClassName("com.android.settings", ChooseLockGeneric.class.getName()); intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.MINIMUM_QUALITY_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING); + intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.HIDE_DISABLED_PREFS, true); startActivityForResult(intent, CHOOSE_LOCK_GENERIC_REQUEST); } } diff --git a/src/com/android/settings/SetupChooseLockGeneric.java b/src/com/android/settings/SetupChooseLockGeneric.java index 94ff8d6de..f29f08a07 100644 --- a/src/com/android/settings/SetupChooseLockGeneric.java +++ b/src/com/android/settings/SetupChooseLockGeneric.java @@ -110,7 +110,7 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric * @param quality the requested quality. */ @Override - protected void disableUnusablePreferences(final int quality) { + protected void disableUnusablePreferences(final int quality, boolean hideDisabled) { // At this part of the flow, the user has already indicated they want to add a pin, // pattern or password, so don't show "None" or "Slide". We disable them here and set // the HIDE_DISABLED flag to true to hide them. This only happens for setup wizard. |