diff options
author | Michael Bestas <mikeioannina@gmail.com> | 2015-04-04 04:43:43 +0300 |
---|---|---|
committer | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-02-03 14:41:21 -0800 |
commit | eaa16db73c61aa3e1f32aacb740492456b59f4ac (patch) | |
tree | 545e892e1f26362ceb8622ab47f68a8de39538d5 /src/com/android/settings/SecuritySettings.java | |
parent | 12f383c8813274806bfcaf74058311ebc558a234 (diff) | |
download | packages_apps_Settings-eaa16db73c61aa3e1f32aacb740492456b59f4ac.zip packages_apps_Settings-eaa16db73c61aa3e1f32aacb740492456b59f4ac.tar.gz packages_apps_Settings-eaa16db73c61aa3e1f32aacb740492456b59f4ac.tar.bz2 |
Forward port pattern visibility settings (2/2)
Change-Id: Ic627953c5df854c442671a98b5da539b994da18b
Diffstat (limited to 'src/com/android/settings/SecuritySettings.java')
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 7c24854..450273b 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -88,6 +88,8 @@ public class SecuritySettings extends SettingsPreferenceFragment // Lock Settings private static final String KEY_UNLOCK_SET_OR_CHANGE = "unlock_set_or_change"; private static final String KEY_VISIBLE_PATTERN = "visiblepattern"; + private static final String KEY_VISIBLE_ERROR_PATTERN = "visible_error_pattern"; + private static final String KEY_VISIBLE_DOTS = "visibledots"; private static final String KEY_SECURITY_CATEGORY = "security_category"; private static final String KEY_DEVICE_ADMIN_CATEGORY = "device_admin_category"; private static final String KEY_LOCK_AFTER_TIMEOUT = "lock_after_timeout"; @@ -120,8 +122,8 @@ public class SecuritySettings extends SettingsPreferenceFragment // These switch preferences need special handling since they're not all stored in Settings. private static final String SWITCH_PREFERENCE_KEYS[] = { KEY_LOCK_AFTER_TIMEOUT, - KEY_VISIBLE_PATTERN, KEY_POWER_INSTANTLY_LOCKS, KEY_SHOW_PASSWORD, - KEY_TOGGLE_INSTALL_APPLICATIONS }; + KEY_VISIBLE_PATTERN, KEY_VISIBLE_ERROR_PATTERN, KEY_VISIBLE_DOTS, + KEY_POWER_INSTANTLY_LOCKS, KEY_SHOW_PASSWORD, KEY_TOGGLE_INSTALL_APPLICATIONS }; // Only allow one trust agent on the platform. private static final boolean ONLY_ONE_TRUST_AGENT = true; @@ -139,6 +141,8 @@ public class SecuritySettings extends SettingsPreferenceFragment private ListPreference mLockAfter; private SwitchPreference mVisiblePattern; + private SwitchPreference mVisibleErrorPattern; + private SwitchPreference mVisibleDots; private SwitchPreference mShowPassword; @@ -300,6 +304,13 @@ public class SecuritySettings extends SettingsPreferenceFragment // visible pattern mVisiblePattern = (SwitchPreference) root.findPreference(KEY_VISIBLE_PATTERN); + // visible error pattern + mVisibleErrorPattern = (SwitchPreference) root.findPreference( + KEY_VISIBLE_ERROR_PATTERN); + + // visible dots + mVisibleDots = (SwitchPreference) root.findPreference(KEY_VISIBLE_DOTS); + // lock instantly on power key press mPowerButtonInstantlyLocks = (SwitchPreference) root.findPreference( KEY_POWER_INSTANTLY_LOCKS); @@ -697,8 +708,13 @@ public class SecuritySettings extends SettingsPreferenceFragment final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils(); if (mVisiblePattern != null) { - mVisiblePattern.setChecked(lockPatternUtils.isVisiblePatternEnabled( - MY_USER_ID)); + mVisiblePattern.setChecked(lockPatternUtils.isVisiblePatternEnabled(MY_USER_ID)); + } + if (mVisibleErrorPattern != null) { + mVisibleErrorPattern.setChecked(lockPatternUtils.isShowErrorPath(MY_USER_ID)); + } + if (mVisibleDots != null) { + mVisibleDots.setChecked(lockPatternUtils.isVisibleDotsEnabled(MY_USER_ID)); } if (mPowerButtonInstantlyLocks != null) { mPowerButtonInstantlyLocks.setChecked(lockPatternUtils.getPowerButtonInstantlyLocks( @@ -788,6 +804,10 @@ public class SecuritySettings extends SettingsPreferenceFragment updateLockAfterPreferenceSummary(); } else if (KEY_VISIBLE_PATTERN.equals(key)) { lockPatternUtils.setVisiblePatternEnabled((Boolean) value, MY_USER_ID); + } else if (KEY_VISIBLE_ERROR_PATTERN.equals(key)) { + lockPatternUtils.setShowErrorPath((Boolean) value, MY_USER_ID); + } else if (KEY_VISIBLE_DOTS.equals(key)) { + lockPatternUtils.setVisibleDotsEnabled((Boolean) value, MY_USER_ID); } else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) { mLockPatternUtils.setPowerButtonInstantlyLocks((Boolean) value, MY_USER_ID); } else if (KEY_SHOW_PASSWORD.equals(key)) { |