diff options
author | 2014-10-20 12:58:58 +0000 | |
---|---|---|
committer | 2014-10-20 12:59:00 +0000 | |
commit | 9c5896b808f77295aa5cd09cb37ad01bccd7994c (patch) | |
tree | 087c83caf89f18903a4f0cb330155678f16200c1 | |
parent | 67b404d688e8da44d104d54c78a8e37f88a4529b (diff) | |
parent | 89f7f281e3633dbfa195a8bf9beb13d3a69898b6 (diff) |
Merge "Always execute resumeAppSwitches when launching something" into lmp-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 9492a1452d99..f5e5517b731c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -266,6 +266,14 @@ public abstract class BaseStatusBar extends SystemUI implements if (DEBUG) { Log.v(TAG, "Notification click handler invoked for intent: " + pendingIntent); } + // The intent we are sending is for the application, which + // won't have permission to immediately start an activity after + // the user switches to home. We know it is safe to do at this + // point, so make sure new activity switches are now allowed. + try { + ActivityManagerNative.getDefault().resumeAppSwitches(); + } catch (RemoteException e) { + } final boolean isActivity = pendingIntent.isActivity(); if (isActivity) { final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing(); @@ -278,11 +286,6 @@ public abstract class BaseStatusBar extends SystemUI implements try { ActivityManagerNative.getDefault() .keyguardWaitingForActivityDrawn(); - // The intent we are sending is for the application, which - // won't have permission to immediately start an activity after - // the user switches to home. We know it is safe to do at this - // point, so make sure new activity switches are now allowed. - ActivityManagerNative.getDefault().resumeAppSwitches(); } catch (RemoteException e) { } } @@ -1486,20 +1489,21 @@ public abstract class BaseStatusBar extends SystemUI implements if (mIsHeadsUp) { mHeadsUpNotificationView.clear(); } - AsyncTask.execute(new Runnable() { + new Thread() { @Override public void run() { - if (keyguardShowing && !afterKeyguardGone) { - try { + try { + if (keyguardShowing && !afterKeyguardGone) { ActivityManagerNative.getDefault() .keyguardWaitingForActivityDrawn(); - // The intent we are sending is for the application, which - // won't have permission to immediately start an activity after - // the user switches to home. We know it is safe to do at this - // point, so make sure new activity switches are now allowed. - ActivityManagerNative.getDefault().resumeAppSwitches(); - } catch (RemoteException e) { } + + // The intent we are sending is for the application, which + // won't have permission to immediately start an activity after + // the user switches to home. We know it is safe to do at this + // point, so make sure new activity switches are now allowed. + ActivityManagerNative.getDefault().resumeAppSwitches(); + } catch (RemoteException e) { } if (mIntent != null) { @@ -1524,7 +1528,7 @@ public abstract class BaseStatusBar extends SystemUI implements // system process is dead if we're here. } } - }); + }.start(); // close the shade if it was open animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); |