Loading core/java/android/widget/RemoteViews.java +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.widget; import android.annotation.ColorInt; import android.app.ActivityManager.StackId; import android.app.ActivityOptions; import android.app.ActivityThread; import android.app.Application; Loading Loading @@ -228,6 +229,11 @@ public class RemoteViews implements Parcelable, Filter { public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { return onClickHandler(view, pendingIntent, fillInIntent, StackId.INVALID_STACK_ID); } public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent, int launchStackId) { try { // TODO: Unregister this handler if PendingIntent.FLAG_ONE_SHOT? Context context = view.getContext(); Loading @@ -239,6 +245,10 @@ public class RemoteViews implements Parcelable, Filter { 0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); } if (launchStackId != StackId.INVALID_STACK_ID) { opts.setLaunchStackId(launchStackId); } context.startIntentSender( pendingIntent.getIntentSender(), fillInIntent, Intent.FLAG_ACTIVITY_NEW_TASK, Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +17 −5 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ package com.android.systemui.statusbar; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.ActivityOptions; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; Loading Loading @@ -347,7 +349,7 @@ public abstract class BaseStatusBar extends SystemUI implements }, afterKeyguardGone); return true; } else { return super.onClickHandler(view, pendingIntent, fillInIntent); return superOnClickHandler(view, pendingIntent, fillInIntent); } } Loading Loading @@ -384,7 +386,8 @@ public abstract class BaseStatusBar extends SystemUI implements private boolean superOnClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { return super.onClickHandler(view, pendingIntent, fillInIntent); return super.onClickHandler(view, pendingIntent, fillInIntent, StackId.FULLSCREEN_WORKSPACE_STACK_ID); } private boolean handleRemoteInput(View view, PendingIntent pendingIntent, Intent fillInIntent) { Loading Loading @@ -994,7 +997,7 @@ public abstract class BaseStatusBar extends SystemUI implements } TaskStackBuilder.create(mContext) .addNextIntentWithParentStack(intent) .startActivities(null, .startActivities(getActivityOptions(), new UserHandle(UserHandle.getUserId(appUid))); overrideActivityPendingAppTransition(keyguardShowing); } catch (RemoteException e) { Loading Loading @@ -1744,7 +1747,7 @@ public abstract class BaseStatusBar extends SystemUI implements } catch (RemoteException e) { } try { intent.send(); intent.send(null, 0, null, null, null, null, getActivityOptions()); } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. // Just log the exception message. Loading Loading @@ -1852,7 +1855,8 @@ public abstract class BaseStatusBar extends SystemUI implements } } try { intent.send(); intent.send(null, 0, null, null, null, null, getActivityOptions()); } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. // Just log the exception message. Loading Loading @@ -1928,6 +1932,14 @@ public abstract class BaseStatusBar extends SystemUI implements } } protected Bundle getActivityOptions() { // Anything launched from the notification shade should always go into the // fullscreen stack. ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchStackId(StackId.FULLSCREEN_WORKSPACE_STACK_ID); return options.toBundle(); } protected void visibilityChanged(boolean visible) { if (mVisible != visible) { mVisible = visible; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +4 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,9 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.NonNull; import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.ActivityOptions; import android.app.IActivityManager; import android.app.Notification; import android.app.PendingIntent; Loading Loading @@ -3091,8 +3093,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, null, mContext.getBasePackageName(), intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, null, UserHandle.CURRENT.getIdentifier()); null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, getActivityOptions(), UserHandle.CURRENT.getIdentifier()); } catch (RemoteException e) { Log.w(TAG, "Unable to start activity", e); } Loading Loading
core/java/android/widget/RemoteViews.java +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.widget; import android.annotation.ColorInt; import android.app.ActivityManager.StackId; import android.app.ActivityOptions; import android.app.ActivityThread; import android.app.Application; Loading Loading @@ -228,6 +229,11 @@ public class RemoteViews implements Parcelable, Filter { public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { return onClickHandler(view, pendingIntent, fillInIntent, StackId.INVALID_STACK_ID); } public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent, int launchStackId) { try { // TODO: Unregister this handler if PendingIntent.FLAG_ONE_SHOT? Context context = view.getContext(); Loading @@ -239,6 +245,10 @@ public class RemoteViews implements Parcelable, Filter { 0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); } if (launchStackId != StackId.INVALID_STACK_ID) { opts.setLaunchStackId(launchStackId); } context.startIntentSender( pendingIntent.getIntentSender(), fillInIntent, Intent.FLAG_ACTIVITY_NEW_TASK, Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +17 −5 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ package com.android.systemui.statusbar; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.ActivityOptions; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; Loading Loading @@ -347,7 +349,7 @@ public abstract class BaseStatusBar extends SystemUI implements }, afterKeyguardGone); return true; } else { return super.onClickHandler(view, pendingIntent, fillInIntent); return superOnClickHandler(view, pendingIntent, fillInIntent); } } Loading Loading @@ -384,7 +386,8 @@ public abstract class BaseStatusBar extends SystemUI implements private boolean superOnClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { return super.onClickHandler(view, pendingIntent, fillInIntent); return super.onClickHandler(view, pendingIntent, fillInIntent, StackId.FULLSCREEN_WORKSPACE_STACK_ID); } private boolean handleRemoteInput(View view, PendingIntent pendingIntent, Intent fillInIntent) { Loading Loading @@ -994,7 +997,7 @@ public abstract class BaseStatusBar extends SystemUI implements } TaskStackBuilder.create(mContext) .addNextIntentWithParentStack(intent) .startActivities(null, .startActivities(getActivityOptions(), new UserHandle(UserHandle.getUserId(appUid))); overrideActivityPendingAppTransition(keyguardShowing); } catch (RemoteException e) { Loading Loading @@ -1744,7 +1747,7 @@ public abstract class BaseStatusBar extends SystemUI implements } catch (RemoteException e) { } try { intent.send(); intent.send(null, 0, null, null, null, null, getActivityOptions()); } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. // Just log the exception message. Loading Loading @@ -1852,7 +1855,8 @@ public abstract class BaseStatusBar extends SystemUI implements } } try { intent.send(); intent.send(null, 0, null, null, null, null, getActivityOptions()); } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. // Just log the exception message. Loading Loading @@ -1928,6 +1932,14 @@ public abstract class BaseStatusBar extends SystemUI implements } } protected Bundle getActivityOptions() { // Anything launched from the notification shade should always go into the // fullscreen stack. ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchStackId(StackId.FULLSCREEN_WORKSPACE_STACK_ID); return options.toBundle(); } protected void visibilityChanged(boolean visible) { if (mVisible != visible) { mVisible = visible; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +4 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,9 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.NonNull; import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.ActivityOptions; import android.app.IActivityManager; import android.app.Notification; import android.app.PendingIntent; Loading Loading @@ -3091,8 +3093,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, null, mContext.getBasePackageName(), intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, null, UserHandle.CURRENT.getIdentifier()); null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, getActivityOptions(), UserHandle.CURRENT.getIdentifier()); } catch (RemoteException e) { Log.w(TAG, "Unable to start activity", e); } Loading