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

Commit 775699dc authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Post setSwitchingUser to main thread" into oc-dev

parents 4be9b2ca 4e44fced
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ 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)
@@ -1398,7 +1399,11 @@ public class KeyguardViewMediator extends SystemUI {
    }

    public void setSwitchingUser(boolean switching) {
        KeyguardUpdateMonitor.getInstance(mContext).setSwitchingUser(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();
    }

    /**
@@ -1538,6 +1543,11 @@ 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;
            }
        }
    };