Commit Graph

563 Commits

Author SHA1 Message Date
Chris Li
ca4cd1a963 Merge "Wait for TaskFragmentOrganizer to finish handling transaction" into tm-qpr-dev am: 3294ef42e4 am: 570d249c9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19564031

Change-Id: I860a58b9810dff8f844e1116c812ef95eea01516
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 05:56:05 +00:00
Chris Li
4e9c5b44b1 Wait for TaskFragmentOrganizer to finish handling transaction
When a TaskFragmentTransaction is sent to the organizer during a
transition, have the transition wait for the organizer to finish
handling the transaction.

Bug: 207070762
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I4b7955171cd8ce386686ff2cd64b7c04a6436ddf
2022-08-23 09:46:05 +08:00
Chris Li
f215542792 Merge "Apply TaskFragmentOrganizer changes in one WCT (2/2)" into tm-qpr-dev 2022-08-21 02:07:04 +00:00
Chris Li
660101fdc7 Apply TaskFragmentOrganizer changes in one WCT (2/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Bug: 240519866
Test: pass existing
Change-Id: I943d6232ff226ed6f67367fa9b7f73e1f861de64
Merged-In: I943d6232ff226ed6f67367fa9b7f73e1f861de64
2022-08-20 20:19:57 +08:00
Chris Li
87cc485c6a Apply TaskFragmentOrganizer changes in one WCT (2/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Bug: 240519866
Test: pass existing
Change-Id: I943d6232ff226ed6f67367fa9b7f73e1f861de64
2022-08-20 17:38:36 +08:00
Chris Li
45c117ef7d Merge "Apply TaskFragmentOrganizer changes in one WCT (1/2)" into tm-qpr-dev am: 2224d4712a am: 364b73aa31
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19588352

Change-Id: I863c89d6dbce617f9014bb385734e33b9aad4a43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 17:11:55 +00:00
Chris Li
c8587817c4 Merge "Address TaskFragmentOrganizer style comments" into tm-qpr-dev am: 153bf507fd am: 5003636f7a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19590596

Change-Id: I2cb6c3c432e33aeaf432679728edca39c7e1944a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 17:05:23 +00:00
Chris Li
2224d4712a Merge "Apply TaskFragmentOrganizer changes in one WCT (1/2)" into tm-qpr-dev 2022-08-19 08:56:42 +00:00
Chris Li
153bf507fd Merge "Address TaskFragmentOrganizer style comments" into tm-qpr-dev 2022-08-19 03:30:11 +00:00
Chris Li
e9a1037439 Apply TaskFragmentOrganizer changes in one WCT (1/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Will update the TestAPI in the followup cl.

Bug: 240519866
Test: pass existing
Change-Id: I2e15b187bee95193874d76bc6963d3e01eba3910
2022-08-17 08:51:03 +08:00
Chris Li
99da16cdc8 Address TaskFragmentOrganizer style comments
1. Rename onActivityReparentToTask to onActivityReparentedToTask
2. Annotate @NonNull and @Nullable for the Extensions methods that are
   not yet annotated.

Bug: 240519866
Test: Refactor and add annotation. Pass existing tests.
Change-Id: I85c5927e6e7261cae3bce715b1955523d430e1e2
2022-08-17 08:46:28 +08:00
Gaurav Bhola
15a8232e38 Merge "Handle alwaysOnTop in DisplayAreas." into tm-qpr-dev 2022-08-12 03:23:30 +00:00
Tony Huang
f05ddf7262 Merge "Add setForceTranslucent API" into tm-qpr-dev am: 103a3b441f am: 6d4e72cb4d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19534875

Change-Id: I28265c978ad074f0b2e11870836e4b2c3da301f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 07:53:43 +00:00
Tony Huang
103a3b441f Merge "Add setForceTranslucent API" into tm-qpr-dev 2022-08-11 06:51:28 +00:00
Shan Huang
0be76567fe Merge "Respect the enforce flag for callback registration." into tm-qpr-dev am: a2c8daf7d1 am: fa21ec758e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19563307

Change-Id: Ib397a041f574fcd547ebb556ef56970087ce979c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 23:05:00 +00:00
Shan Huang
a2c8daf7d1 Merge "Respect the enforce flag for callback registration." into tm-qpr-dev 2022-08-09 22:34:23 +00:00
Shan Huang
d6c5d36d1c Respect the enforce flag for callback registration.
Predictive back infra respect the enforce flag everywhere else (e.g. for
compat / default callback registrations), so we follow the same pattern
here.

This flag is a development only flag, so this CL should not affect
droidfood or public builds.

Test: `adb shell setprop persist.wm.debug.predictive_back_always_enforce
1`. Restart. Check apps can register callbacks without opting in (e.g.
   can swipe back to LS from bouncer)

Change-Id: I7d5a85b37b50b11f6e4be28d022dd0e528a7d4fd
2022-08-09 00:39:07 +00:00
Tony Huang
f93ff02d21 Add setForceTranslucent API
Add this api for split screen improve enter transition.

When we start intent on side stage task, the top split root task
will go to top and current top one task will be set as invisible
then cause black screen due to split root task is full screen.
Solve this by use new wct api setForceTranslucent to make split
root task as translucent when split inactive. We need to reset
it when split active otherwise it cause flicker when back to home.

Bug: 223325631
Bug: 235029020
Test: atest WmTests
Change-Id: I28df2879345718b726af9fdb7ea54644c77ab925
2022-08-08 11:28:38 +00:00
Chris Li
f3bf098243 Merge "Pass Task configuration changed for all TaskFragments at once" into tm-qpr-dev am: 678fb7f436 am: 50443fe2f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19482729

Change-Id: Ie41ca928938550f35c2b092e642a51677b2b6557
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-06 02:41:30 +00:00
Chris Li
678fb7f436 Merge "Pass Task configuration changed for all TaskFragments at once" into tm-qpr-dev 2022-08-06 00:02:07 +00:00
Gaurav Bhola
ef72f1134b Handle alwaysOnTop in DisplayAreas.
- Also add setAlwaysOnTop API in WindowContainerTransaction.

Bug: 188102153
Test: atest DisplayAreaTest
Test: Tested manually by setting it on DisplayAreas
Change-Id: I683e3c6bdf1bb6a590829a197f5dbef2c171d7e9
Merged-In: I683e3c6bdf1bb6a590829a197f5dbef2c171d7e9
2022-08-04 10:05:24 -07:00
TreeHugger Robot
4ab5a9873c Merge "Convert TaskFragmentOrganizer callbacks to a transaction callback" into tm-qpr-dev am: d600010bc5 am: 50051d1535
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19449149

Change-Id: I7621a0b432c0118072e337887733518026493390
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 11:28:48 +00:00
TreeHugger Robot
d600010bc5 Merge "Convert TaskFragmentOrganizer callbacks to a transaction callback" into tm-qpr-dev 2022-08-04 11:12:36 +00:00
Chris Li
8980a9fe87 Pass Task configuration changed for all TaskFragments at once
Before, we passed Task configuration changed for every embedded
TaskFragment. Now, we only passed one Task configuration changed for the
whole Task. The organizer will then update TaskFragments in the Task
accordingly.

Bug: 240519866
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I755c11a1bcee0dd0305a090b229e867b79eee46d
2022-08-04 10:50:11 +08:00
Chris Li
6b94ca2d5f Convert TaskFragmentOrganizer callbacks to a transaction callback
Before, we have several different callbacks, such as
onTaskFragmentAppeared, onTaskFragmentInfoChanged, etc. As migrating to
Shell transition, we need a new model to better sync between app
process, WM Core and Shell.

The flow will be:
1. WM Shell startTransition with a WindowContainerTransaction
2. After apply the WCT, notify TaskFragmentOrganizerController
3. TFOrganizerController pack the TF related events into one transaction
4. TFOrganizerController call deferTransitionReady and send the
   transaction to the TFOrganizer in app process
5. TFOrganizer update TFs based on the transaction and apply a WCT
6. When TFOrganizerController get that WCT, call continueTransitionReady

Bug: 240519866
Test: pass existing
Change-Id: I110953f7b73f565a2b1299ef5c3827eaa39e84b8
2022-08-04 10:32:34 +08:00
TreeHugger Robot
f8b45dd301 Merge "Add willShowImeOnTarget in RemoteAnimationTarget(Compat)" into tm-qpr-dev am: 5c0ba8f0f5 am: 442b26f30d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19395267

Change-Id: Icc7c12431ee12ca8046702a25bce06b34a2d0f2e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 13:23:06 +00:00
TreeHugger Robot
5c0ba8f0f5 Merge "Add willShowImeOnTarget in RemoteAnimationTarget(Compat)" into tm-qpr-dev 2022-08-02 13:05:02 +00:00
Wei Sheng Shih
83c72c89b7 Merge "Inject back key events if no focus window found." into tm-qpr-dev am: 117bab591c am: 23c3dd0294
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19144840

Change-Id: I678242b3a7b6164c6782b82040d386417971f8dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 12:22:57 +00:00
Wei Sheng Shih
117bab591c Merge "Inject back key events if no focus window found." into tm-qpr-dev 2022-08-02 11:40:59 +00:00
Gaurav Bhola
63faf7908a Merge "Handle alwaysOnTop in DisplayAreas." 2022-07-29 21:53:33 +00:00
Gaurav Bhola
335c26296b Handle alwaysOnTop in DisplayAreas.
- Also add setAlwaysOnTop API in WindowContainerTransaction.

Bug: 188102153
Test: atest DisplayAreaTest
Test: Tested manually by setting it on DisplayAreas
Change-Id: I683e3c6bdf1bb6a590829a197f5dbef2c171d7e9
2022-07-29 09:11:21 -07:00
Tiger Huang
ae9d2aa672 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d am: 3995c4d303
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: Ic48b954694b8d6cafce8b421dcbcd94f63793acc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:47:33 +00:00
Tiger Huang
93a238d15d Merge "Send size-compat scale to the client" into tm-qpr-dev 2022-07-29 08:56:14 +00:00
wilsonshih
f22e6b03ef Inject back key events if no focus window found.
If user applied a back gesture but core cannot find a focus window,
inject back key event, so that event can dispatch to client once it
gain focus window. And since the gesture was happened, treat it as
onBackPressed.
And if device is playing recents animation but the focus window is
point to live tile, we can also inject back key because Home/Recents
activity shall not have the same behavior as normal app.

Bug: 237629607
Test: cross test that back gesture can finish recents with legacy/shell
transition on Nexus/3rd launcher.
Test: test on BackTestApp for both 3btn mode and gesture mode.
Test: atest AnrTests BackNavigationLegacyGestureTest
Test: atest OnBackInvokedDispatcherTest KeyboardVisibilityControlTest
BackInvokedOnWidgetTest BackNavigationTests BackNavigationControllerTests

Change-Id: If754e66ea7c1c4ec313c45d17d7f6c10bfc2c465
2022-07-29 13:00:54 +08:00
Arthur Hung
a97e9a07d5 Merge "Cancel back invoke when window focus has lost" into tm-qpr-dev am: f52b49886c am: 89c25ce1f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19415501

Change-Id: Id8175c049118c567a47563ef361afa416c7b9810
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 01:55:46 +00:00
Ming-Shin Lu
ce1a4f3fe5 Add willShowImeOnTarget in RemoteAnimationTarget(Compat)
..used for signaling the launcher to crop the
remote animation target bounds when task animating on the taskbar.

If the task will show IME on the top means the animation taget would not
need to be cropped according to the taskBar insets, since visually the
taskbar is hidden when IME is visible.

Bug: 219981732
Test: manual as steps
 0) enable taskbar with Settings > Developer options > Smallest width
    as 600dp.
 1) launch an app from all apps and show the IME by tapping the editor.
 2) swipe out to home and launch it again by pressing the shortcut.
 3) Verify the animating task preview with IME shown without being
    cropped.

Change-Id: Iab526e78614c68626bd5424e0e3219044f671f4d
2022-07-28 15:41:26 +00:00
Arthur Hung
e3476afe2a Cancel back invoke when window focus has lost
This reverts commit 0099ca8fab and provide
new mechanism.

The back invoke target could lost focus during back navigation gesture.
To prevent the non-focused window could still trigger back action cause
some unexpected behavior, this CL will listen the focus change of
current focused window and cancel back gesture when its focus has lost.

Bug: 238050065
Bug: 239792909
Test: atest BackNavigationControllerTests
Test: atest BackNavigationLegacyGestureTest BackNavigationLegacyTest
Test: atest BackNavigationTests
Test: atest WindowOnBackInvokedDispatcherTest BackNavigationTest
Test: atset BackAnimationControllerTest

Change-Id: I65eb19371020ce39977eeb2a2a80c7f08600aaec
2022-07-28 06:42:10 +00:00
Louis Chang
61bfe6e0dc Sending TaskFragmentInfo and operation type in #onTaskFragmentError
So, the TaskFragmentOrganizer can know what exact operation was
failed and perform error handles if needed.

Removes the pending appeared activities when starting/reparenting
activity into a TaskFragment was failed.

Deprecating the #onTaskFragmentError method with another overloaded
version, but still making sure the deprecated one is called in order
to make it compatible with Android T CTS.

Bug: 236668365
Bug: 233989810
Test: atest TaskFragmentTest
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest
Test: atest TaskFragmentOrganizerPolicyTest
Change-Id: Id328d037536d32b3acb9c424d36052b6dca8628a
Merged-In: Id328d037536d32b3acb9c424d36052b6dca8628a
2022-07-28 01:36:38 +00:00
Tiger Huang
c77eaf873d Send size-compat scale to the client
The client computes the window frame on its own in ViewRootImpl#setView.
However, the bounds obtained from WindowConfiguration is not size-
compatible, which makes legacy apps produce wrong frames. The frame is
larger than expected, so when computing WindowInsets with size-
compatible InsetsState, the window cannot receive insets.

Although the client will receive the correct window frame from relayout,
but the first WindowInsets has been dispatched before that.

This CL sends the size-compat scale to the client, so the client can use
the correct WindowConfiguration to compute frames.

This is also a step to enable the client to perform local window layout.

Bug: 237749017
Bug: 161810301
Bug: 175861127
Test: atest StartingSurfaceDrawerTests WindowAddRemovePerfTest
      ActivityRecordTests WindowManagerServiceTests
Change-Id: I6b23901f4b1f009444c04da7e078ea971a386ad7
2022-07-27 14:10:10 +08:00
Chavi Weingarten
864e6a7963 Create default implementation for getSyncTarget
AttachedSurfaceControl is a public API so hidden APIs need to be
implemented. Create a default implementation for a new hidden API to
ensure backwards compatibility.

Test: testRuntimeCompatibilityWithCurrentApi_android_net_ipsec_ike
Fixes: 240300753
Change-Id: I4aec403e4bc13e2db902a291f1e42d8fe3d8fdf3
2022-07-26 21:42:04 +00:00
chaviw
ea372b7faa Refactor SurfaceSyncer to use SurfaceSyncGroups instead of syncId
There's no need for SurfaceSyncer to store the SyncSets and only return
a syncId. The callers can instead own the SyncGroups and call methods
directly on them. This makes the code more readable and cleans up Syncer
since you can directly call methods instead of piping through an outer
method.

Test: SurfaceSyncGroupContinuousTest
Test: SurfaceSyncGroupTest
Change-Id: I82976e26e10e20d2752e6be24a45069a6a64e849
Bug: 237804605
2022-07-25 16:11:54 -05:00
Louis Chang
251c0051b8 Merge "Sending TaskFragmentInfo and operation type in #onTaskFragmentError" 2022-07-25 07:48:15 +00:00
Louis Chang
3caf83ca9e Sending TaskFragmentInfo and operation type in #onTaskFragmentError
So, the TaskFragmentOrganizer can know what exact operation was
failed and perform error handles if needed.

Removes the pending appeared activities when starting/reparenting
activity into a TaskFragment was failed.

Bug: 236668365
Bug: 233989810
Test: atest TaskFragmentTest
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest
Test: atest TaskFragmentOrganizerPolicyTest
Change-Id: Id328d037536d32b3acb9c424d36052b6dca8628a
2022-07-25 00:22:42 +00:00
Shan Huang
0ac31bf658 Merge "Remove TODOs for adding CTS tests." 2022-07-23 19:10:52 +00:00
Arthur Hung
2f37be9bf0 Merge "Ignore back invoke when window focus has lost" into tm-qpr-dev am: 1476873423 am: 6ce8c4a98c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19291068

Change-Id: I928da7e6e5907b7bafbdec85e92b8bc7f056afbf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 05:28:26 +00:00
Arthur Hung
0099ca8fab Ignore back invoke when window focus has lost
The back invoke target could lost focus during back navigation.
To prevent the non-focused window could still trigger back action cause
some unexpected behavior, this CL will listen focus changed and skip the
back invoke call.

Test: launch a trampoline activity and trigger back before next activity
shown.
Test: atest WindowOnBackInvokedDispatcherTest
Bug: 238050065

Change-Id: Ifd345b2283c5d07628e2884db6e4e13f3ec31e83
2022-07-20 04:26:45 +00:00
Chris Li
3a89fdb4f0 Merge "Add ActivityEmbedding transition handler in Shell" into tm-qpr-dev am: 62e147fbce am: a62788c732
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19238521

Change-Id: I233aa3bb5970a4f6f2974bcece279a924105cbcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 19:46:55 +00:00
Chris Li
b6cca29bb5 Add ActivityEmbedding transition handler in Shell
Jumpcut for transitions that are all embedded.

Bug: 207070762
Test: pass existing
Change-Id: I8da7647477d24b895ff1b140fca7c8774918c531
2022-07-18 21:44:31 +08:00
Jeff Chang
6244734266 Merge "Handle the uncontrolled task in split-screen" into tm-qpr-dev am: 9e73750458 am: bef1e16c59
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19166690

Change-Id: I6796fc981d6ac07394c0acba4909cee534ecdef7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-11 06:34:55 +00:00
Jeff Chang
89f86c1813 Handle the uncontrolled task in split-screen
Exit the split-screen in case users put the uncontrolled task into
split-screen. This CL do below change to support handling this task.
   1. If no controlling activity appeared, dismiss the split screen
      and show a toast to inform users.
   2. Reparent all tasks out of split root when dismissing instead of
      just reparent controlling tasks.
   3. Disable the split-item from launcher for tasks that are
      uncontrolled.

Bug: 230461945
Bug: 208646963
Bug: 238032411
Test: atest MultiWindowTests
      atest WMShellUnitTests
Change-Id: Iab59561e9d532b10dab8f5063047c4b68b73eb87
2022-07-08 12:40:27 +08:00