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

Commit 61e8ef9f authored by Wysie's avatar Wysie
Browse files

Added code to allow configurable delay on incorrect pattern input.

parent 792b12d6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ public class DragLock extends View implements LockPattern {
    
    private boolean mTactileFeedbackEnabled = true;
    
    private int mDelay = 1500;

    private float mDiameterFactor = 0.5f;
    private float mHitFactor = 0.6f;

@@ -334,7 +336,11 @@ public class DragLock extends View implements LockPattern {
    }

    public int getIncorrectDelay() {
        return 1500;
        return mDelay;
    }
    
    public void setIncorrectDelay(int delay) {
        mDelay = delay;
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -96,5 +96,6 @@ public interface LockPattern {
    public void enableInput();
    public int getCorrectDelay();
    public int getIncorrectDelay();
    public void setIncorrectDelay(int delay);
    public View getView();
}
+9 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public class LockPatternUtils {
    private final static String LOCK_SHOW_CUSTOM_MSG = "lockscreen.showcustommsg";
    private final static String LOCK_CUSTOM_MSG = "lockscreen.custommsg";
    private final static String LOCK_SHOW_SLIDERS = "lockscreen.showsliders";
    private final static String LOCK_INCORRECT_DELAY = "lockscreen.incorrectdelay";

    private static final int PIN_CHECK_TIMEOUT_MIN = 500;
    private static final int PIN_CHECK_TIMEOUT_DEFAULT = 1500;
@@ -336,6 +337,14 @@ public class LockPatternUtils {
        return getBoolean(LOCK_SHOW_SLIDERS);
    }
    
    public int getIncorrectDelay() {
        return getInt(LOCK_INCORRECT_DELAY, 1500);
    }
    
    public void setIncorrectDelay(int delay) {
        setInt(LOCK_INCORRECT_DELAY, delay);
    }

    /**
     * Set whether tactile feedback for the pattern is enabled.
     */
+6 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ public class PinLock extends View implements LockPattern {
    private boolean mTactileFeedbackEnabled = true;
    private boolean mVisibleDots = true;
    private boolean mShowErrorPath = true;
    private int mDelay = 1500;

    private float mSquareWidth;
    private float mSquareHeight;
@@ -242,7 +243,11 @@ public class PinLock extends View implements LockPattern {
    }

    public int getIncorrectDelay() {
        return 1500;
        return mDelay;
    }
    
    public void setIncorrectDelay(int delay) {
        mDelay = delay;
    }

    private long[] loadVibratePattern(int id) {