diff options
author | Danesh M <daneshm90@gmail.com> | 2012-08-18 00:58:42 -0400 |
---|---|---|
committer | Danesh Mondegarian <daneshm90@gmail.com> | 2013-03-01 20:26:03 -0500 |
commit | c98a1803c3195e29f9e70c9595a0e5887e915be8 (patch) | |
tree | 73955f1ebeb52f101b22f38af0df39dc2313d92e | |
parent | 2afb91bbabc66b783e30466185435fe8adcc0b79 (diff) | |
download | packages_apps_settings-c98a1803c3195e29f9e70c9595a0e5887e915be8.zip packages_apps_settings-c98a1803c3195e29f9e70c9595a0e5887e915be8.tar.gz packages_apps_settings-c98a1803c3195e29f9e70c9595a0e5887e915be8.tar.bz2 |
LockscreenPattern : Toggle dots/error pattern visibility (2/2)
Give user ability to hide error pattern / dots.
Patchset 2 : Cleanup commit msg
Change-Id: Ifdd4615c7116f974a0a67079d58a521e84d76367
-rw-r--r-- | res/values/strings.xml | 4 | ||||
-rw-r--r-- | res/xml/security_settings_pattern.xml | 11 | ||||
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 27 |
3 files changed, 40 insertions, 2 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 9d848fc..9972b13 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2450,6 +2450,10 @@ <string name="lockpattern_settings_enable_summary">Must draw pattern to unlock screen</string> <!-- Security & location settings screen, setting check box title. This setting controls whether a visible green line is drawn as the user moves his finger around while drawing the unlock pattern. If checked, this line is drawn. If unchecked, there is nothing drawn so the user does not reveal his pattern while he unlocks the phone.--> <string name="lockpattern_settings_enable_visible_pattern_title">Make pattern visible</string> + <!-- Security & location settings screen, setting check box title. This setting controls whether a visible red line will be drawn after the user has drawn the unlock pattern incorrectly. If checked, this line is drawn. If unchecked, there is nothing drawn so the user does not reveal his pattern while he unlocks the phone.--> + <string name="lockpattern_settings_enable_error_path_title">Show pattern error</string> + <!-- Security & location settings screen, setting check box title. This setting controls whether the dots will be drawn when using the lockscreen pattern.--> + <string name="lockpattern_settings_enable_dots_title">Show pattern dots</string> <!-- Security & location settings screen, setting check box title. This setting controls whether tactile feedback will be produced when the user draws the pattern.--> <string name="lockpattern_settings_enable_tactile_feedback_title">Vibrate on touch</string> <!-- Security & location settings screen, setting check box title. This controls whether the device locks immediately when the power button is pressed. [CHAR LIMIT=28]--> diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml index d47a99d..6151bc6 100644 --- a/res/xml/security_settings_pattern.xml +++ b/res/xml/security_settings_pattern.xml @@ -28,8 +28,19 @@ <CheckBoxPreference android:key="visiblepattern" + android:persistent="false" android:title="@string/lockpattern_settings_enable_visible_pattern_title"/> + <CheckBoxPreference + android:key="visible_error_pattern" + android:persistent="false" + android:title="@string/lockpattern_settings_enable_error_path_title"/> + + <CheckBoxPreference + android:key="visibledots" + android:persistent="false" + android:title="@string/lockpattern_settings_enable_dots_title"/> + <ListPreference android:key="lock_after_timeout" android:title="@string/lock_after_timeout" diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 85d76b3..14a4cf4 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -64,6 +64,8 @@ public class SecuritySettings extends SettingsPreferenceFragment private static final String KEY_BIOMETRIC_WEAK_LIVELINESS = "biometric_weak_liveliness"; private static final String KEY_LOCK_ENABLED = "lockenabled"; 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"; @@ -100,6 +102,8 @@ public class SecuritySettings extends SettingsPreferenceFragment private CheckBoxPreference mBiometricWeakLiveliness; private CheckBoxPreference mVisiblePattern; + private CheckBoxPreference mVisibleErrorPattern; + private CheckBoxPreference mVisibleDots; private CheckBoxPreference mShowPassword; @@ -247,6 +251,12 @@ public class SecuritySettings extends SettingsPreferenceFragment // visible pattern mVisiblePattern = (CheckBoxPreference) root.findPreference(KEY_VISIBLE_PATTERN); + // visible error pattern + mVisibleErrorPattern = (CheckBoxPreference) root.findPreference(KEY_VISIBLE_ERROR_PATTERN); + + // visible dots + mVisibleDots = (CheckBoxPreference) root.findPreference(KEY_VISIBLE_DOTS); + // lock instantly on power key press mPowerButtonInstantlyLocks = (CheckBoxPreference) root.findPreference( KEY_POWER_INSTANTLY_LOCKS); @@ -327,8 +337,11 @@ public class SecuritySettings extends SettingsPreferenceFragment DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) { PreferenceGroup securityCategory = (PreferenceGroup) root.findPreference(KEY_SECURITY_CATEGORY); - if (securityCategory != null && mVisiblePattern != null) { - securityCategory.removePreference(root.findPreference(KEY_VISIBLE_PATTERN)); + if (securityCategory != null && mVisiblePattern != null && + mVisibleErrorPattern != null && mVisibleDots != null) { + securityCategory.removePreference(mVisiblePattern); + securityCategory.removePreference(mVisibleErrorPattern); + securityCategory.removePreference(mVisibleDots); } } @@ -583,6 +596,12 @@ public class SecuritySettings extends SettingsPreferenceFragment if (mVisiblePattern != null) { mVisiblePattern.setChecked(lockPatternUtils.isVisiblePatternEnabled()); } + if (mVisibleErrorPattern != null) { + mVisibleErrorPattern.setChecked(lockPatternUtils.isShowErrorPath()); + } + if (mVisibleDots != null) { + mVisibleDots.setChecked(lockPatternUtils.isVisibleDotsEnabled()); + } if (mPowerButtonInstantlyLocks != null) { mPowerButtonInstantlyLocks.setChecked(lockPatternUtils.getPowerButtonInstantlyLocks()); } @@ -641,6 +660,10 @@ public class SecuritySettings extends SettingsPreferenceFragment lockPatternUtils.setLockPatternEnabled(isToggled(preference)); } else if (KEY_VISIBLE_PATTERN.equals(key)) { lockPatternUtils.setVisiblePatternEnabled(isToggled(preference)); + } else if (KEY_VISIBLE_ERROR_PATTERN.equals(key)) { + lockPatternUtils.setShowErrorPath(isToggled(preference)); + } else if (KEY_VISIBLE_DOTS.equals(key)) { + lockPatternUtils.setVisibleDotsEnabled(isToggled(preference)); } else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) { lockPatternUtils.setPowerButtonInstantlyLocks(isToggled(preference)); } else if (preference == mSlideLockDelayToggle) { |