summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java31
2 files changed, 32 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index c09e4c4..9448bbf 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -190,8 +190,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
Intent chooserIntent = Intent.createChooser(sharingIntent, null);
- chooserIntent.addFlags(Intent.FLAG_ACTIVITY_CLOSE_SYSTEM_DIALOGS
- | Intent.FLAG_ACTIVITY_CLEAR_TASK
+ chooserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
| Intent.FLAG_ACTIVITY_NEW_TASK);
mNotificationBuilder.addAction(R.drawable.ic_menu_share,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 08016df..04cff96 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -155,6 +155,35 @@ public abstract class BaseStatusBar extends SystemUI implements
}
};
+ private RemoteViews.OnClickHandler mOnClickHandler = new RemoteViews.OnClickHandler() {
+ @Override
+ public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) {
+ final boolean isActivity = pendingIntent.isActivity();
+ if (isActivity) {
+ try {
+ // 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();
+ // Also, notifications can be launched from the lock screen,
+ // so dismiss the lock screen when the activity starts.
+ ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
+ } catch (RemoteException e) {
+ }
+ }
+
+ boolean handled = super.onClickHandler(view, pendingIntent, fillInIntent);
+
+ if (isActivity && handled) {
+ // close the shade if it was open
+ animateCollapse(CommandQueue.FLAG_EXCLUDE_NONE);
+ visibilityChanged(false);
+ }
+ return handled;
+ }
+ };
+
public void start() {
mDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
@@ -548,8 +577,10 @@ public abstract class BaseStatusBar extends SystemUI implements
View expandedLarge = null;
Exception exception = null;
try {
+ oneU.setOnClickHandler(mOnClickHandler);
expandedOneU = oneU.apply(mContext, adaptive);
if (large != null) {
+ large.setOnClickHandler(mOnClickHandler);
expandedLarge = large.apply(mContext, adaptive);
}
}