diff options
| author | 2018-02-23 11:19:45 -0800 | |
|---|---|---|
| committer | 2018-02-23 15:14:00 -0800 | |
| commit | 52d3dfd2afd88a138697a165ed618fbd3c3fc240 (patch) | |
| tree | 03b14fb5b795db4a1f65b511577a1109b11de574 | |
| parent | 4e69759e63c380c40cae5e52bc9e24e49e1c047c (diff) | |
Fixed an issue where the collapsing was called on the wrong thread
With work profiles, the collapsing of the panel would happen on the wrong
thread.
Change-Id: I617465d9b285d456162bb7d9ed6ee27659ab1134
Fixes: 73728329
Test: unlock work profile from work profile notification
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 4ffe5fe019c0..933c952903cd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -4985,7 +4985,7 @@ public class StatusBar extends SystemUI implements DemoMode, notificationKey)) { // Show work challenge, do not run PendingIntent and // remove notification - collapsePanel(); + collapseOnMainThread(); return; } } @@ -5026,11 +5026,7 @@ public class StatusBar extends SystemUI implements DemoMode, } } if (shouldCollapse()) { - if (Looper.getMainLooper().isCurrentThread()) { - collapsePanel(); - } else { - mStackScroller.post(this::collapsePanel); - } + collapseOnMainThread(); } try { @@ -5058,6 +5054,14 @@ public class StatusBar extends SystemUI implements DemoMode, }, afterKeyguardGone); } + private void collapseOnMainThread() { + if (Looper.getMainLooper().isCurrentThread()) { + collapsePanel(); + } else { + mStackScroller.post(this::collapsePanel); + } + } + private boolean shouldCollapse() { return mState != StatusBarState.SHADE || !mActivityLaunchAnimator.isAnimationPending(); } |