Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f9a6afa authored by Wysie's avatar Wysie
Browse files

- Implemented 2 additional options.

- "Show unlock message" will hide the "Draw pattern to unlock" message
- "Show unlock error messages" will hide the "Sorry, try again" message
- However, if you get the incorrect pattern, it will still show the 30 seconds countdown. That is not configurable, don't intend to make it configurable as well.
parent 597ea9a9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1385,6 +1385,8 @@
    <string name="lockpattern_settings_enable_visible_pattern_title">Use visible pattern</string>
    <string name="lockpattern_settings_enable_visible_dots_title">Use visible dots</string>
    <string name="lockpattern_settings_show_error_path">Show incorrect path on error</string>
    <string name="lockpattern_settings_show_unlock_msg">Show unlock message</string>
    <string name="lockpattern_settings_show_unlock_error_msg">Show unlock error messages</string>
    <string name="lockpattern_settings_show_custom_msg">Show custom message</string>
    <string name="lockpattern_settings_show_sliders">Show sliders</string>
    <string name="lockpattern_settings_custom_msg">Custom message</string>
+22 −0
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ public class SecuritySettings extends PreferenceActivity {
    private static final String KEY_SHOW_ERROR_PATH = "showerrorpath";
    private static final String KEY_SHOW_CUSTOM_MSG = "showcustommsg";
    private static final String KEY_SHOW_SLIDERS = "showsliders";
    private static final String KEY_SHOW_UNLOCK_MSG = "showunlockmsg";
    private static final String KEY_SHOW_UNLOCK_ERR_MSG = "showunlockerrmsg";

    private static final int CONFIRM_PATTERN_THEN_DISABLE_AND_CLEAR_REQUEST_CODE = 55;

@@ -87,6 +89,8 @@ public class SecuritySettings extends PreferenceActivity {
    private CheckBoxPreference mShowErrorPath;
    private CheckBoxPreference mShowCustomMsg;
    private EditTextPreference mCustomMsg;
    private CheckBoxPreference mShowUnlockMsg;
    private CheckBoxPreference mShowUnlockErrMsg;
    //private CheckBoxPreference mShowSliders;
    private ListPreference mIncorrectDelay;
    private CheckBoxPreference mTactileFeedback;
@@ -196,6 +200,18 @@ public class SecuritySettings extends PreferenceActivity {
        mShowErrorPath.setTitle(R.string.lockpattern_settings_show_error_path);
        inlinePrefCat.addPreference(mShowErrorPath);
        
        // show unlock msg        
        mShowUnlockMsg = new CheckBoxPreference(this);
        mShowUnlockMsg.setKey(KEY_SHOW_UNLOCK_MSG);
        mShowUnlockMsg.setTitle(R.string.lockpattern_settings_show_unlock_msg);
        inlinePrefCat.addPreference(mShowUnlockMsg);
        
        // show unlock error msg        
        mShowUnlockErrMsg = new CheckBoxPreference(this);
        mShowUnlockErrMsg.setKey(KEY_SHOW_UNLOCK_ERR_MSG);
        mShowUnlockErrMsg.setTitle(R.string.lockpattern_settings_show_unlock_error_msg);
        inlinePrefCat.addPreference(mShowUnlockErrMsg);

        // show custom msg
        mShowCustomMsg = new CheckBoxPreference(this);
        mShowCustomMsg.setKey(KEY_SHOW_CUSTOM_MSG);
@@ -308,6 +324,8 @@ public class SecuritySettings extends PreferenceActivity {
        mVisibleDots.setChecked(mLockPatternUtils.isVisibleDotsEnabled());
        mShowErrorPath.setChecked(mLockPatternUtils.isShowErrorPath());
        mShowCustomMsg.setChecked(mLockPatternUtils.isShowCustomMsg());
        mShowUnlockMsg.setChecked(mLockPatternUtils.isShowUnlockMsg());
        mShowUnlockErrMsg.setChecked(mLockPatternUtils.isShowUnlockErrMsg());
        mCustomMsg.setText(mLockPatternUtils.getCustomMsg());
        //mShowSliders.setChecked(mLockPatternUtils.isShowSliders());
        mTactileFeedback.setChecked(mLockPatternUtils.isTactileFeedbackEnabled());
@@ -374,6 +392,10 @@ public class SecuritySettings extends PreferenceActivity {
            mLockPatternUtils.setVisibleDotsEnabled(isToggled(preference));
        } else if (KEY_SHOW_ERROR_PATH.equals(key)) {
            mLockPatternUtils.setShowErrorPath(isToggled(preference));
        } else if (KEY_SHOW_UNLOCK_MSG.equals(key)) {
            mLockPatternUtils.setShowUnlockMsg(isToggled(preference));
        } else if (KEY_SHOW_UNLOCK_ERR_MSG.equals(key)) {
            mLockPatternUtils.setShowUnlockErrMsg(isToggled(preference));
        } else if (KEY_SHOW_CUSTOM_MSG.equals(key)) {
            mLockPatternUtils.setShowCustomMsg(isToggled(preference));
        } /*else if (KEY_SHOW_SLIDERS.equals(key)) {