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

Commit aa1575fb authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix race condition with PIN char delete

This CL is an attempt to fix a race condition that exists but
one that I cannot find. Protect the code from crashing, and reset
the bouncer state if this happens.

Fixes: 395234761
Test: manual, attempt to race
Flag: EXEMPT bugfix
Change-Id: Ic0d251aa09ffcef9ac1b29632c4ed1917d655782
parent ce9dc350
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -226,6 +226,12 @@ public class PasswordTextView extends BasePasswordTextView {

    @Override
    protected void onDelete(int index) {
        if (index >= mTextChars.size()) {
            // An inconsistency was detected. The parent class deleted a char which is not present
            // in this one. call reset() to restart
            reset(false, false);
            return;
        }
        CharState charState = mTextChars.get(index);
        charState.startRemoveAnimation(0, 0);
    }