Commit Graph

694 Commits

Author SHA1 Message Date
Chris Li
3eab0a1997 Merge "Cleanup TaskFragmentOrganizer#applyTransaction" 2022-12-12 07:49:55 +00:00
Chris Li
1eed824821 Merge "Fix ActivityEmbedding placeholder launching above fullscreen activity" into tm-qpr-dev am: 4706a5c650 am: 058fef7318
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20647614

Change-Id: I308413b4c294a90e2fd85fbbd65737d3f57735a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-09 00:55:39 +00:00
Chris Li
058fef7318 Merge "Fix ActivityEmbedding placeholder launching above fullscreen activity" into tm-qpr-dev am: 4706a5c650
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20647614

Change-Id: I8e51bd63e2b25065d0f98eaa1ae176cd99858be7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-09 00:30:42 +00:00
Chris Li
55e086c2ec Cleanup TaskFragmentOrganizer#applyTransaction
Replace the existing usage with the overload method, which is introduced
to sync TaskFragmentOrganizer with other transition.

Introduced TaskFragmentTransitionType to avoid exposing Shell transition
API to CTS.

Bug: 232476698
Test: pass existing
Change-Id: I666b9ee6b6076766513b97e675fdbaa002428601
2022-12-08 11:01:44 +08:00
Chris Li
7ed3a9c3f9 Fix ActivityEmbedding placeholder launching above fullscreen activity
Before, we always place the new created TaskFragment on the top of the
Task. Now, when creating TaskFragment for placeholder, we place the new
TasKFragment right above the primary TaskFragment.

In case there is a fullscreen transparent Activity on top of the primary
Activity, this prevents us from launching the placeholder on top of the
transparent Activity.

Bug: 261550242
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I163e9ca1637db45e8695d40a31f2a2c6a4f05189
2022-12-08 08:38:17 +08:00
Adrian Roos
abaac9ba70 Merge "Remove dangling javadoc" am: 6d61168c0d am: 9b13491142
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2325337

Change-Id: Ia0803f9f3e0d720a93a455a4ec76b8c6df1f50cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 14:24:59 +00:00
Adrian Roos
9b13491142 Merge "Remove dangling javadoc" am: 6d61168c0d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2325337

Change-Id: I01d1573fd6e0e88e1f0513ee30346252386e3321
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 14:04:10 +00:00
Iris Yang
976f3a2c98 Merge "Specify the tasks should be exculded from Recents or not" 2022-12-07 04:36:02 +00:00
TreeHugger Robot
3b1489ea55 Merge "Remove dangling javadoc" 2022-12-06 11:18:49 +00:00
Jeff Chang
978eb93813 [RESTRICT AUTOMERGE] WCT#setReparentLeafTaskIfRelaunch am: 835262451e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20352020

Change-Id: Ia398af6751a0042fcc684c031360c7b3e7a16b66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 09:17:02 +00:00
Jeff Chang
34f0af63c4 Merge "Introduce WCT#setReparentLeafTaskIfRelaunch" 2022-12-06 07:03:04 +00:00
Jeff Chang
835262451e [RESTRICT AUTOMERGE] WCT#setReparentLeafTaskIfRelaunch
This CL allows disassociating the leaf task if relaunched and
reparented it to TDA as root task for split-screen.

Bug: 236317871
Test: atest WindowOrganizerTests

Change-Id: I6704fab733ed7d239d7004c93d3d2f471ac94822
Merged-In: I6704fab733ed7d239d7004c93d3d2f471ac94822
2022-12-06 06:55:09 +00:00
Shan Huang
9f0809b264 Merge "Make OnBackAnimationCallback and BackEvent public." 2022-12-05 19:38:42 +00:00
Adrian Roos
b704a2809b Remove dangling javadoc
Removes javadoc that appears in places where it is not considered as such
by javac / metalava.

Test: compiles
Change-Id: I701d7dfe17db67e4735e0ded4ff1c3e0ddb3bfa2
2022-12-05 12:48:56 +00:00
Massimo Carli
70de08a63b Merge "Apply rounded corners to startWindow" into tm-qpr-dev am: 6db1ce2740 am: 60c604f7de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20222491

Change-Id: Ib8ff69b9233c311e0da8b194271fb11a79931c0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 10:22:14 +00:00
Massimo Carli
60c604f7de Merge "Apply rounded corners to startWindow" into tm-qpr-dev am: 6db1ce2740
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20222491

Change-Id: I3ad8e6719a64c63ac911f66debf50bdf91ae045c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 09:47:51 +00:00
Massimo Carli
f4976b84a3 Apply rounded corners to startWindow
This removes the corner animation flickering happening when
starting a letterboxed app after a configuration change
(eg. Dark/Light mode)

Test: Manual
Fixes: 234107097

Change-Id: Iad9f4aaeb8edeeb56b0c88d7d0239843cd66a8f9
2022-12-03 13:25:16 +00:00
Adrian Roos
7a5b16cdbd Remove dangling javadoc
Removes javadoc that appears in places where it is not considered as such
by javac / metalava.

Test: compiles
Change-Id: I701d7dfe17db67e4735e0ded4ff1c3e0ddb3bfa2
2022-12-02 16:31:35 +00:00
wilsonshih
f8801f5069 Extract the drawing logic from StartingSurfaceDrawer.
Prepare for windowless starting surface. Attemp to decouple the drawing
methods from window related handling.
Move most of snapshot drawing method together to a utility class
SnapshotDrawerUtils, so SystemBarBackgroundPainter now can shared for
shell and core.

Bug: 131727607
Bug: 257857570
Test: atest SnapshotDrawerUtilsTest StartingSurfaceDrawerTests
Test: hot launch an app, and verify snapshot starting window show up
without issue.
Test: cold launch app, verify icon style splash screen can show.

Change-Id: I4d2c04e41d375cf6c8711a60977b8f24dddd41c0
2022-12-02 12:11:30 +00:00
Iris Yang
111c9923e0 Specify the tasks should be exculded from Recents or not
Add API setRecentsPolicy in VirtualDeviceParams to give a display owner
to be able to indicate that any activity/task on their display should be
excluded from recents or not.

Bug: 234075973
Test: atest VirtualDeviceParamsTest
Change-Id: Iae71bafbd285c7a9dca07c084e30a7c72f735958
2022-12-02 11:49:10 +08:00
Jeff Chang
76dfa76cae Introduce WCT#setReparentLeafTaskIfRelaunch
This CL allows disassociating the leaf task if relaunched and
reparented it to TDA as root task for split-screen.

Bug: 236317871
Test: atest WindowOrganizerTests

Change-Id: I6704fab733ed7d239d7004c93d3d2f471ac94822
2022-12-02 10:33:47 +08:00
Evan Rosky
38fc799aae Merge "Manually manage memory of native objects" into tm-qpr-dev am: 2971d9f3e0 am: fe11a03335
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20554503

Change-Id: I0bf096b6dd291b2aead4e37bf63a4f60d7170037
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 19:42:15 +00:00
Shan Huang
79195a44ce Make OnBackAnimationCallback and BackEvent public.
Bug: 238475284
Test: BackNavigationGestureTest
Test: BackAnimationControllerTest
Change-Id: Ib342a92add166d804336653ab868bc0349540b2c
2022-11-30 09:00:28 -08:00
Evan Rosky
fe11a03335 Merge "Manually manage memory of native objects" into tm-qpr-dev am: 2971d9f3e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20554503

Change-Id: Ib65f7f146134f70e4e84efa0816d62c54c100ad0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 19:19:32 +00:00
Evan Rosky
34a703b4c5 Manually manage memory of native objects
Even though these surfaces/transactions are unreachable, it still
takes time for the GC/NativeRegistry/FinalizerQueue to actually
flush/free references (even if you force GC, it won't flush the
NativeRegistry/FinalizerQueue). This skews the results of our
memory benchmark tests since they measure instantaneous memory.

So, add logic to manually release Transactions/SurfaceControls
when we know they won't be used. This is extra tricky due to
unparceling creating new refcounts. To resolve this, we assume
that all remotes are getting a COPY of all surfaces and then we
make deep-ish copies on the CALLER side if the binder is actually
local. We can't alter the logic on the receiver side because the
binders are one-way and thus PID information isn't available.

Bug: 258913831
Test: systemui-notification-memory-suite-demo and check aggregates
Change-Id: If094e7eeb248a8674e8094cf5cf3019b2cd58047
2022-11-28 23:20:52 +00:00
TreeHugger Robot
5157dcc01d Merge "Remove @Nullable annotation for onConfigurationChanged." into tm-qpr-dev am: 05fafde8c8 am: 2c450d9930
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20545848

Change-Id: I2187596fed6de7827bed75b663071245e5a86c6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 23:19:31 +00:00
TreeHugger Robot
2c450d9930 Merge "Remove @Nullable annotation for onConfigurationChanged." into tm-qpr-dev am: 05fafde8c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20545848

Change-Id: I74e007689759e6b954e775bd50f3e2bc304d1637
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 22:40:55 +00:00
An An Yu
5f5f20fd8e Remove @Nullable annotation for onConfigurationChanged.
Test: none

Bug: 237342281
Change-Id: Ia9e971152b7e297a78d79cbb79690f66d3029c9f
2022-11-28 18:01:14 +00:00
Toshiki Kikuchi
a67c16c04f Merge "Introduce WCT#clearAdjacentRoots()" 2022-11-24 00:55:00 +00:00
Toshiki Kikuchi
ef2bb4ffbb Introduce WCT#clearAdjacentRoots()
This CL adds clearAdjacentRoots() to WCT as the “inversion” of
setAdjacentRoots().
ARC needs this capability because adjacency of the split roots
depends on the device status and it should be possible to switch
that in runtime.

Bug: 245239136
Test: WindowOrganizerTests
Change-Id: I59fb28508d56973fe4643f4c4a7deee6d29cbb4f
2022-11-21 17:28:00 +09:00
Arthur Hung
514e45af2c Add server side proto-base dumping for back navigation
This CL implements a mechanism to dump the state of back navigation
in BackNavigationController to a proto buffer which we can easily
check the state while runing test case.

This also add @TestApi for BackNavigationInfo.

Bug: 131727607
Test: atest BackNavigationGestureTest
Change-Id: I8918f0b8095177578e23eb92547bd705ccfa7ec1
2022-11-21 06:59:27 +00:00
Chris Li
d44ef3070a Merge "Only override ActivityEmbedding animation for embedded activities" into tm-qpr-dev am: c9b69ab91d am: de7539843c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20475428

Change-Id: I70ebafd2b630be2e0f9379aa9548c23ffbc677fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-19 04:26:25 +00:00
Chris Li
de7539843c Merge "Only override ActivityEmbedding animation for embedded activities" into tm-qpr-dev am: c9b69ab91d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20475428

Change-Id: I86e5258bb672c0aa1bc25ebcc45b3d5069eaa528
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-19 03:51:37 +00:00
Chris Li
c9b69ab91d Merge "Only override ActivityEmbedding animation for embedded activities" into tm-qpr-dev 2022-11-19 03:32:16 +00:00
Wei Sheng Shih
b6d85cd980 Merge "Ensure the animation finish sequence by synchronize call." 2022-11-17 08:16:32 +00:00
An An Yu
85093f9854 Merge "Add WindowProvider support to WindowLayoutComponentImpl and allow WindowProviderService to broadcast configuration changes to listeners." into tm-qpr-dev am: 63cd60eeb2 am: 6e11d27d69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20267030

Change-Id: Ib41335c7b1f1c62b566f7953cdba428f1e07eff1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 08:14:54 +00:00
An An Yu
6e11d27d69 Merge "Add WindowProvider support to WindowLayoutComponentImpl and allow WindowProviderService to broadcast configuration changes to listeners." into tm-qpr-dev am: 63cd60eeb2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20267030

Change-Id: I0c7257d9e85c335aa39ed344bf23a1324c36a5bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 07:47:34 +00:00
An An Yu
63cd60eeb2 Merge "Add WindowProvider support to WindowLayoutComponentImpl and allow WindowProviderService to broadcast configuration changes to listeners." into tm-qpr-dev 2022-11-17 07:39:47 +00:00
Chris Li
d7725b5272 Only override ActivityEmbedding animation for embedded activities
Before, we check if there is any split rule meeting the bounds
requirement for the given Task bounds in order to determine whether or
not to override the animation.

This can cause issue when the apps later unregister the split rules
while there is existing split. Also, this is hard to determine as we now
have SplitAttributesCalculator which can change the split state for the
same bounds.

To fix these problem, we now check if the app transition contains any
embedded activity (embedded TaskFragment that is not filling Task), to
determine if the animation should be played by the organizer.

Fix: 242051445
Test: atest WmTests:AppTransitionControllerTest
Change-Id: Ie90ba085cab3d4072f47cc3599d0494324fa39a9
2022-11-17 15:00:28 +08:00
Louis Chang
782fb1812d Merge "Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT" into tm-qpr-dev am: d0767e2bc2 am: 3d4d9d8876
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20310351

Change-Id: I178f472772bf5318300bacdc4c5292580feafac5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 03:56:00 +00:00
Louis Chang
3d4d9d8876 Merge "Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT" into tm-qpr-dev am: d0767e2bc2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20310351

Change-Id: Iffd5b72abe24f5f77839dadda8ac952a68440fd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 03:29:58 +00:00
Louis Chang
d0767e2bc2 Merge "Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT" into tm-qpr-dev 2022-11-17 02:56:54 +00:00
An An Yu
4a999424a3 Add WindowProvider support to WindowLayoutComponentImpl and allow
WindowProviderService to broadcast configuration changes to listeners.

This is needed to allow IME to listen to WindowLayoutInfo changes.

Bug: 237342281
Test: CTS InputMethodServiceTest
Change-Id: Id8ddce5889b52859172caf3b4f0763bb5010b5dc
2022-11-17 01:13:17 +00:00
Louis Chang
24920c208d Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev am: b73cda834c am: e20ffee9dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278150

Change-Id: Ia1193d7790c8dda3ab693027b905b60915de326e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 01:12:19 +00:00
Louis Chang
e20ffee9dd Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev am: b73cda834c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278150

Change-Id: I2b133d0cd5ea3dcb8ce038f1972f778c30048006
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 00:45:22 +00:00
Louis Chang
b73cda834c Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev 2022-11-17 00:21:08 +00:00
Chavi Weingarten
64d5d93bd7 Merge "Remove onSyncComplete from SurfaceSyncGroup" 2022-11-16 14:02:51 +00:00
wilsonshih
5d54c1b6ea Ensure the animation finish sequence by synchronize call.
By making IBackAnimationFinishedCallback synchronize call, the client
app won't have chance to create a transition before core receives
onAnimationFinished, which could play the second close animation from
that transition.

Note: Shell side change can be found in ag/20459278.

Bug: 131727607
Test: monitor client won't create close transition before core handled
onAnimationFinished.

Change-Id: Iad3c70c14727d438633d804a573000f8b71b023e
2022-11-16 16:17:22 +08:00
Louis Chang
99b9449724 Move the task to back while pressing back on the last activity
... of the secondary (or the primary) container.

The primary container was removed along with the secondary container
while the last Activity in the secondary container was finished by
back event. Therefore, starting window will be shown if starting the
app again from Launcher.

However, the last Activity in the secondary container should be
considered as a relative task root if the Activity is displayed
adjacently or being a companion with the task root activity.
The task should be moved to back vs. finishes the Activities to
speed up the launch next time, like commit 2dec42fa does.

Bug: 240669850
Test: launch Settings
Test: atest WindowOrganizerTests
Change-Id: I13b33afb8602f63062f6b33742453c3e93fdfc20
2022-11-16 02:26:37 +00:00
Louis Chang
5dc3ec5115 Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT
Application was crashed while starting an embedded Activity with
FLAG_ACTIVITY_REORDER_TO_FRONT, because the embedded Activity was
not the direct child of the Task.

In this CL, the embedded activity is now moved to the top-most
position of the Task and dismissed from being embedded in order
to honer FLAG_ACTIVITY_REORDER_TO_FRONT.

Bug: 255701223
Test: locally verified with app
Test: atest TaskTests
Change-Id: I491139e5e1d712993f1fef9aebbd75e9ccfc539e
2022-11-16 01:34:24 +00:00