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

Commit dc0b1cab authored by Michael Bestas's avatar Michael Bestas
Browse files

SystemUI: Read PIN scramble setting from current user

* Fixes a bug where secondary users get the PIN scrambled from user0
  settings instead of their own settings.

Change-Id: I8f8034f7950c9bd89504c41f12ff57707f6e0790
parent 4328a0c5
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.keyguard;
package com.android.keyguard;


import android.content.Context;
import android.content.Context;
import android.os.UserHandle;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
@@ -132,8 +133,9 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
            });
            });
        }
        }


        mScramblePin = LineageSettings.System.getInt(getContext().getContentResolver(),
        mScramblePin = LineageSettings.System.getIntForUser(getContext().getContentResolver(),
                LineageSettings.System.LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, 0) == 1;
                LineageSettings.System.LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, 0,
                UserHandle.USER_CURRENT) == 1;
        if (mScramblePin) {
        if (mScramblePin) {
            Collections.shuffle(sNumbers);
            Collections.shuffle(sNumbers);
            // get all children who are NumPadKey's
            // get all children who are NumPadKey's
+5 −2
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.TypedArray;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.SystemClock;
import android.os.UserHandle;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.view.HapticFeedbackConstants;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.LayoutInflater;
@@ -115,8 +116,10 @@ public class NumPadKey extends ViewGroup {
    }
    }


    private void updateText() {
    private void updateText() {
        boolean scramblePin = (LineageSettings.System.getInt(getContext().getContentResolver(),
        boolean scramblePin = LineageSettings.System.getIntForUser(
                LineageSettings.System.LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, 0) == 1);
                getContext().getContentResolver(),
                LineageSettings.System.LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, 0,
                UserHandle.USER_CURRENT) == 1;
        if (mDigit >= 0) {
        if (mDigit >= 0) {
            mDigitText.setText(Integer.toString(mDigit));
            mDigitText.setText(Integer.toString(mDigit));
            if (sKlondike == null) {
            if (sKlondike == null) {