diff options
author | d34d <clark@cyngn.com> | 2016-01-07 09:30:27 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-12 15:01:45 -0800 |
commit | 9f84cac5057433b38c0950244a453305a0a0a6ac (patch) | |
tree | c225457f0986f6ca408c543f2d25b96f67757d2c | |
parent | 8406b5c2b96ed8bdab0a1eb9bec4814ee5baa34a (diff) | |
download | frameworks_base-9f84cac5057433b38c0950244a453305a0a0a6ac.zip frameworks_base-9f84cac5057433b38c0950244a453305a0a0a6ac.tar.gz frameworks_base-9f84cac5057433b38c0950244a453305a0a0a6ac.tar.bz2 |
SysUI: Handle KgdExtView callbacks on UI thread
These callbacks can happen off the UI thread and some of the actions
we perform require us to be on the UI thread.
Change-Id: Ic3d7007b2df0630d4bdd511d34acde20c1a16a34
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 688ed65..1536137 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1193,18 +1193,30 @@ public class NotificationPanelView extends PanelView implements @Override public boolean requestDismiss() { if (hasExternalKeyguardView()) { - mStatusBar.setBarState(StatusBarState.KEYGUARD); - mStatusBar.showBouncer(); + post(new Runnable() { + @Override + public void run() { + mStatusBar.showKeyguard(); + mStatusBar.showBouncer(); + } + }); return true; } return false; } @Override - public boolean requestDismissAndStartActivity(Intent intent) { + public boolean requestDismissAndStartActivity(final Intent intent) { if (hasExternalKeyguardView()) { - mStatusBar.setBarState(StatusBarState.KEYGUARD); - mStatusBar.startActivity(intent, true); + if (hasExternalKeyguardView()) { + post(new Runnable() { + @Override + public void run() { + mStatusBar.showKeyguard(); + mStatusBar.startActivity(intent, true); + } + }); + } return true; } return false; @@ -1212,8 +1224,14 @@ public class NotificationPanelView extends PanelView implements @Override public void collapseNotificationPanel() { - if (mStatusBar.getBarState() == StatusBarState.KEYGUARD && hasExternalKeyguardView()) { - mStatusBar.focusKeyguardExternalView(); + if (mStatusBar.getBarState() == StatusBarState.KEYGUARD && hasExternalKeyguardView() && + mKeyguardExternalView.isInteractive()) { + post(new Runnable() { + @Override + public void run() { + mStatusBar.focusKeyguardExternalView(); + } + }); } } |