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

Commit bbe1924b authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed an issue with font sizes between users

Because the user switching callback was posted,
the timing would be off, such that at inflation
time, the user wouldn't be switching, leading
to wrong font sizes in the wrong user.

Change-Id: Ied60acf0a8d1ebe7db18bdb1d786722d1efdcdfc
Fixes: 67507904
Test: switch between users with different font sizes
parent cdf3bd03
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -347,6 +347,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private SparseBooleanArray mUserFaceUnlockRunning = new SparseBooleanArray();

    private static int sCurrentUser;
    private Runnable mUpdateFingerprintListeningState = this::updateFingerprintListeningState;

    public synchronized static void setCurrentUser(int currentUser) {
        sCurrentUser = currentUser;
@@ -1666,7 +1667,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {

    public void setSwitchingUser(boolean switching) {
        mSwitchingUser = switching;
        updateFingerprintListeningState();
        // Since this comes in on a binder thread, we need to post if first
        mHandler.post(mUpdateFingerprintListeningState);
    }

    private void sendUpdates(KeyguardUpdateMonitorCallback callback) {
+1 −11
Original line number Diff line number Diff line
@@ -164,7 +164,6 @@ public class KeyguardViewMediator extends SystemUI {
    private static final int NOTIFY_SCREEN_TURNED_ON = 15;
    private static final int NOTIFY_SCREEN_TURNED_OFF = 16;
    private static final int NOTIFY_STARTED_GOING_TO_SLEEP = 17;
    private static final int SET_SWITCHING_USER = 18;

    /**
     * The default amount of time we stay awake (used for all key input)
@@ -1419,11 +1418,7 @@ public class KeyguardViewMediator extends SystemUI {
    }

    public void setSwitchingUser(boolean switching) {
        Trace.beginSection("KeyguardViewMediator#setSwitchingUser");
        mHandler.removeMessages(SET_SWITCHING_USER);
        Message msg = mHandler.obtainMessage(SET_SWITCHING_USER, switching ? 1 : 0, 0);
        mHandler.sendMessage(msg);
        Trace.endSection();
        KeyguardUpdateMonitor.getInstance(mContext).setSwitchingUser(switching);
    }

    /**
@@ -1563,11 +1558,6 @@ public class KeyguardViewMediator extends SystemUI {
                    Log.w(TAG, "Timeout while waiting for activity drawn!");
                    Trace.endSection();
                    break;
                case SET_SWITCHING_USER:
                    Trace.beginSection("KeyguardViewMediator#handleMessage SET_SWITCHING_USER");
                    KeyguardUpdateMonitor.getInstance(mContext).setSwitchingUser(msg.arg1 != 0);
                    Trace.endSection();
                    break;
            }
        }
    };