diff options
| author | Iris Yang <irisykyang@google.com> | 2021-08-27 18:12:42 +0000 |
|---|---|---|
| committer | Iris Yang <irisykyang@google.com> | 2021-12-15 09:41:22 +0000 |
| commit | 30691cd24d4dfa1683ae409f1d87e1d69d9256ab (patch) | |
| tree | 606087cdbba3928eb30c93bf8fcbbdd5a6dd5fe1 /core/java/android/widget/RemoteViews.java | |
| parent | 0efd62c15763605558639094061fb776b66a5251 (diff) | |
Set launch display id to an action performed on RemoteViews.
When user click notification's action (i.e. answer call), the activity
wouldn't display as the user is interacting with.
Add ActivityOptions#setLaunchDisplayId to the display that the given view
is currently on. So the activity will be launched to the display as the
user is interacting with.
Bug: 191222363
Test: Manually tested using Exo. Open calling application(e.g.WhatsApp)
on Exo virtual display, and answer the call from the notification of
phone.
https://drive.google.com/file/d/1OhS1yn5nCcUe1Aiti3_MLL7k5BLFf7_W/view?resourcekey=0-CCR2Mihn-cfCSIqQZMg-ow
Change-Id: I215519965074b2ddc66eb0a53320673295d4fb17
Diffstat (limited to 'core/java/android/widget/RemoteViews.java')
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 91fc5a56d979..677d2a56a84f 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -6512,6 +6512,7 @@ public class RemoteViews implements Parcelable, Filter { opts = ActivityOptions.makeBasic(); opts.setPendingIntentLaunchFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } + opts.setLaunchDisplayId(view.getDisplay().getDisplayId()); return Pair.create(intent, opts); } } |
