When Activity relaunched, the SplitController will receive
onActivityDestroyed and onActivityCreated.
Before, we always remove all the reference onActivityDestroyed, which
can accidentally remove split pair finish relationship. Now we only
do that when the activity is actually finishing.
Also do the following to make sure there is no other regression:
1. Replace the stored activity reference with activity token, so it
won't be changed when activity relaunched.
2. Update #getContainerWithActivity to first check pending appeared
activity to make sure it returns the correct container before the
server update.
Bug: 260301635
Test: atest WMJetpackUnitTests:SplitControllerTest
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Change-Id: Ife6de66d22e336bb872a9fccbdf03562fe6e089d
Before, we only provide startBounds when the animation target is
MODE_CHANGING, with which we won't know the start bounds for target that
is closing while resizing.
Now, we provide startBounds for all targets, so that we can use it to
provide seamless animation when the target is closing while resizing.
Also make sure the closing container's surface is in the start bounds
before the animation starts to avoid any flicker.
Bug: 241043533
Test: Verify with switching between split and stack.
Change-Id: I4d8e1ee44d418249dcb434425c7ab3d63a429bad
After the horizontal layout feature, the split layout is not just
determined by task bounds, but the whole task Configuration should
be take account.
This CL removes the mTaskBounds logic and consolidate to use
TaskContainer#mConfiguration instead. This CL also introduces
ActivityClient#getTaskConfiguration to obtain task config at
TaskContainer initialization.
Bug: 240219484
Test: atest WMJetpackUnitTests
Change-Id: I5725ac92d841c53675c78b9e50e0d3fee3973f37
For animation spec, before, we only consider animation to/from
left/right. Now, we also check top/bottom.
Bug: 241043533
Test: Verify with launching activity into horizontal split.
Change-Id: Ia7b56105de167a13ada064fe7daf8f1dbae6aa34
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
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
... 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
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
ActivityGroup has been deprecated since Android H, but there are still
apps using it. When it is used, the child Activity will not have its own
corresponding ActivityRecord. If we treat it as normal Activity, there
will be issue because we can't find Task with its token, nor reparent it
with its token.
Skip child Activity (the one launched in ActivityGroup) for any
lifecycle event.
Fix: 256533615
Test: manually verify
Change-Id: Ibccf1575c3b229a0912f843f6468a6c3e24a893f
When switching between horizontal split and vertical split, it will
leave part of the screen empty. Show background color to cover that.
Also fix the leash start position.
Bug: 241043533
Bug: 254090083
Test: verify with horizontal demo app
Change-Id: I5b76ee619462a6822637668ffe86301814db8cea
Before, we only send TaskFragment info event to the client side when the
Task is visible, which may result some TaskFragments stuck in an
intermediate state. Now, we also send the info event to the client if
the app owns any visible Task, and let the client organizer to determine
if it wants to update the TaskFragments.
Bug: 251583070
Fix: 250943776
Fix: 251132298
Test: atest WMJetpackUnitTests:SplitControllerTest
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I47570639c4ed4bdfb4202f65ba4531adbd4a2d2d
Before, we calculate the TransitionType based on the WCT, which may not
be accurate. For example, starting a new Activity to split may result
closing another TaskFragment.
Now, we keep track of where the WCT is started, and what exactly is
happening.
Bug: 207070762
Test: atest WMJetpackUnitTests:TransactionManagerTest
Change-Id: I19a21fac10fa47b75d696d9a5e273c1033ae3982
Also throw exception when there's re-registration for Context/Consumer
callback. At the Extension level we maintain a 1-1 mapping between
Context and Consumer, while Jetpack handles the multicasting.
Test: CTS in same topic.
Change-Id: If0fccd5e52c799fd4aaa9b3637b2f1c78986fc75
Bug: 204073440
The root cause is that TaskFragmentParentInfo wasn't be dispatched
when there's a display or visibility change because we didn't
implement getTaskFragment() in TaskFragment and it led to
the TskFragment can't return itself if the predicate function
returns true.
This CL fixes WC#getTaskFragment and changes to dispatch
Task#shouldBeVisible instead of Task#isVisibleRequested.
The reason is that the visibleRequested change is not early enough for
the scenario that device is folded from unfolded state, and lead to
Settings flickering.
Test: manual - open Settings and fold the device
Test: atest TaskTests#testGetTaskFragment
Test: atest TaskFragmentOrganizerControllerTest ActivityRecordTests
fixes: 249055633
Change-Id: Ie1c56758697d14b426c9ed713da84e49c9f880d8
Before, we call Activity#finish() to finish activities when removing
TaskFragment. This may start a CLOSE transition before the organizer has
a chance to request the actual transition type.
Now, we allow the organizer to finish activities through WCT so that the
operation is atomic and the organizer can request the correct transition
type.
Bug: 240519866
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Test: atest CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerTest
Change-Id: I54671fb2dd34dca952468305429a90d89953de69
This CL implements SplitController#set(clear)SplitAttributesCalculator,
and also invokes #computeSplitAttributesForParams
in #computeSplitAttributes to compute the split attributes based
on the current device state.
fixes: 241043111
fixes: 241043028
Bug: 207494880
Test: atest WMJetpackUnitTests
Change-Id: I0e3aadba451f2e585b048bfe2417239ed2f3ba3c
This CL introduces SplitLayout and update bounds computation methods
to support horizontal layout. It also introduces #computeSplitLayout
to compute the current split layout, which always returns the default
splitLayout currently. #computeSplitLayout will extend to consider
SplitLayoutCalculator in later CL.
fixes: 241042437
Bug: 241043028
Bug: 207494880
Test: atest SplitPresenterTest
Change-Id: I037a2b2fa38d05c4fe97e4734cc044148ad15806
This CL enables to update the current top SplitContainer if
there's a folding state change.
Test: manual - following CLs use this CL
Bug: 207494880
Bug: 241043111
Change-Id: Ia4d08d7f71d935101f3aeda94384295db2fa2214
As we add visibility info in TaskFragmentParentInfo, we can update
the parent Task visibility in onTaskFragmentParentInfoChanged.
It can be furthur used in update SplitContainers of visible containers.
Test: atest WMJetpackUnitTests
Bug: 243609832
Bug: 207494880
Change-Id: Iad4b8d46bad75c352fc6a1a732ef796cdbfad4f9
This CL adds a TaskFragmentParentInfo class and extends
onTaskFragmentParentInfoChanged to dispatch display ID and
visibility of the parent Task.
It makes SplitController able to track visibility and display
changes and used to update SplitContainers if there's a folding
state change.
Test: atest SplitControllerTest TaskFragmentOrganizerControllerTest
Bug: 243609832
Bug: 207494880
Change-Id: If3d5db621b20d4005ce0b60e46ac98e1d1e962e3
Because most of the dependent features are not yet ready, revert it back
in T_QPR1.
Bug: 247950006
Test: pass existing
Change-Id: I451cb0d640f935c542a0e79df8c08945d5c4776c
Make sure the open/close a pair of activities act as one.
Cleanup unused adapter that was introduced for scaling animation, which
is replaced with x coordinate animation in T.
Bug: 241043533
Test: manually verify the animation with legacy transition
Change-Id: I3202895d204d618b4a2d95c9709614a0114543da
Before, we only resolve the Intent if it is called with Activity
context, which skip handling cross-process embedding if the
startActivity is called with Application context.
Now, when startActivity is called with Application context, we will
check if the Intent should be embedded in the known Task in the
organizer process.
Bug: 244411454
Test: atest WMJetpackUnitTests:SplitControllerTest
Change-Id: Ic1ee4f23330b4ce35888c0eabd1ee8eb13d13140
Instead of having WM Core to "guess" when to request transtiion, let the
organizer to tell whether or not it needs to be applied immediately.
With the shouldApplyIndependently parameter, we can make sure the future
runtime API to change split layout won't affect other ongoing
transition.
Bug: 207070762
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I658b0ba1ae9decc741f09cb53bfff2c45ea076a0
Before, we store the TaskFragmentToken in ActivityClientRecord from
LaunchActivityItem, which won't update if the Activity is relaunched.
Now, we update the token when the activity is reparented to make sure
the token is up-to-date when relaunched.
Also make sure that when activity is destroyed, it is no longer
available using SplitController#getContainerWithActivity(Activity).
Bug: 243330085
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Change-Id: I37f1a442c6f1bfb40f04f61eb4f9a3d8d09733ee
Before, we may reuse the existing TaskFragment for secondary activity,
which may be below the primary TaskFragment. Now, we make sure the
secondary TaskFragment is always on top.
Bug: 244254584
Test: atest WMJetpackUnitTests:SplitPresenterTest
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Change-Id: Id4c240af71fbd344126ae8bbbad57d9c2150d550
Refactor TaskFragmentOrganizer#onTransactionReady to
SplitController#onTransactionReady to make sure that the
transaction is handled in one sync block.
Bug: 240519866
Test: pass existing for refactor
Change-Id: I9e7191e2b71ba262e1a3f8c947f9354698382972
Add locks to protect the list of consumers.
We are seeing concurrent modification exceptions because
DeviceStateManager sends changes on a separate thread.
Bug: 241464751
Test: n/a could not generate a non-flaky test.
Change-Id: Ie49c0f4f16db39187c98609ac57734e468c3f507
To make activity embedding library able to listen to folding state
change consistently, we should add WindowContext support to
WindowLayoutComponentImpl, which only supported Activity previously.
This CL can also benefit VoiceInteractionSession support on
WindowLayoutComponent.
Bug: 207494880
Bug: 204073440
Test: use in follow-up CL and report folding state change successfully
Change-Id: I7a4fea6ed00b52996c7cffb33aadb934abe811c8
* changes:
Increments Extensions API version for Rear display API's
Adds support for enabling and disabling rear display mode.
Adds extensions implementation for WindowAreaComponent and rear display status listeners
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