diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-06-25 17:35:36 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-25 17:35:36 -0700 |
commit | 17990395bc62f8ce1bae4f1880899f231a8e613b (patch) | |
tree | 3e27e810159e377634395ac1daf9939169a26313 /packages | |
parent | fca66cd828e214fe7494e46c7daa2879dfc3210d (diff) | |
parent | 1927ae8a56a010919a7535231fa0f7db70f7e152 (diff) | |
download | frameworks_base-17990395bc62f8ce1bae4f1880899f231a8e613b.zip frameworks_base-17990395bc62f8ce1bae4f1880899f231a8e613b.tar.gz frameworks_base-17990395bc62f8ce1bae4f1880899f231a8e613b.tar.bz2 |
Merge "Fix issue #6717667: expanded notification actions don't work on the lock screen" into jb-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java | 3 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 31 |
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); } } |