diff options
| author | 2017-05-10 17:47:45 -0700 | |
|---|---|---|
| committer | 2017-05-15 10:21:15 -0700 | |
| commit | 4e44fcedadf5a43ffabbe71f10181bb2b6b87c78 (patch) | |
| tree | e8079cdcd210b8a3a6b037b2ee71b0c76a97c869 | |
| parent | b827c5234c3087472885790a89fefec9a1f46eed (diff) | |
Post setSwitchingUser to main thread
touching view hierarchy should only occur on UI thread
Bug: 37167272
Test: keyguard still works, used Log to see that switching
still gets called
Change-Id: I45ed9894a8f08c38da40de44f84e99cddb683014
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 88e8b398888e..8d4a05414ccb 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -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) @@ -1393,7 +1394,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(); } /** @@ -1533,6 +1538,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; } } }; |