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

Commit c3c6fdea authored by Steve Kondik's avatar Steve Kondik
Browse files

keyguard: Fix scramble pin

Change-Id: I68357d2a4222911d51c3fda7e1b56c67d0f12cb9
parent 5f1a0335
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -137,24 +137,10 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {

        if (scramblePin) {
            Collections.shuffle(sNumbers);
            // get all children who are NumPadKey's
            LinearLayout bouncer = (LinearLayout) findViewById(R.id.keyguard_bouncer_frame);
            List<NumPadKey> views = new ArrayList<NumPadKey>();
            for (int i = 0; i < bouncer.getChildCount(); i++) {
                if (bouncer.getChildAt(i) instanceof LinearLayout) {
                    LinearLayout nestedLayout = ((LinearLayout) bouncer.getChildAt(i));
                    for (int j = 0; j < nestedLayout.getChildCount(); j++){
                        View view = nestedLayout.getChildAt(j);
                        if (view.getClass() == NumPadKey.class) {
                            views.add((NumPadKey) view);
                        }
                    }
                }
            }

            // reset the digits in the views
            for (int i = 0; i < sNumbers.size(); i++) {
                mViews[(i / 3) + 1][i % 3].setDigit(sNumbers.get(i));
                ((NumPadKey)mViews[(i / 3) + 1][i % 3]).setDigit(sNumbers.get(i));
            }
        }