summaryrefslogtreecommitdiff
path: root/core/java/android/window/TaskFragmentOrganizer.java
Commit message (Collapse)AuthorAgeFilesLines
* Only override ActivityEmbedding animation for embedded activitiesChris Li2022-11-171-8/+5
| | | | | | | | | | | | | | | | | | | 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
* Cleanup unused TestApi in TaskFragmentOrganizerChris Li2022-09-131-140/+21
| | | | | | | | | | | | | The callback handling is moved to SplitController#onTransactionReady, no longer need those TestApi. This is different from the merged-in cl for CTS compatibility in the current release. Bug: 240519866 Test: pass existing Change-Id: I66ddd51c94003254001436ff0505dde3b26d0437 Merged-In: I66ddd51c94003254001436ff0505dde3b26d0437
* Add TaskFragmentOrganizer#applyTransaction with request transitionChris Li2022-09-011-20/+105
| | | | | | | | | | | | | 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
* Handle TaskFragmentOrganizer#onTransactionReady in syncChris Li2022-08-271-6/+22
| | | | | | | | | | 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
* Wait for TaskFragmentOrganizer to finish handling transactionChris Li2022-08-231-7/+25
| | | | | | | | | | 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
* Apply TaskFragmentOrganizer changes in one WCT (2/2)Chris Li2022-08-201-14/+81
| | | | | | | | | | | 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
* Apply TaskFragmentOrganizer changes in one WCT (1/2)Chris Li2022-08-171-4/+19
| | | | | | | | | | | | 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
* Address TaskFragmentOrganizer style commentsChris Li2022-08-171-4/+4
| | | | | | | | | | 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
* Pass Task configuration changed for all TaskFragments at onceChris Li2022-08-041-17/+55
| | | | | | | | | | | 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
* Convert TaskFragmentOrganizer callbacks to a transaction callbackChris Li2022-08-041-45/+71
| | | | | | | | | | | | | | | | | | | | 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
* Sending TaskFragmentInfo and operation type in #onTaskFragmentErrorLouis Chang2022-07-281-10/+47
| | | | | | | | | | | | | | | | | | | | | 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
* Add TaskFragmentOrganizer#onActivityReparentToTaskChris Li2022-04-221-0/+27
| | | | | | | | | | When the activity exits PiP and is reparented to the original Task, the organizer should handle it as a new launch. Bug: 225371112 Test: atest WmTests:TaskFragmentTest Test: atest WmTests:TaskFragmentOrganizerControllerTest Change-Id: Ia7e32e995a35e167b0d76e701c972b269ae068cc
* Register remote animation per TaskChris Li2022-04-011-5/+8
| | | | | | | | | | Before, we register remote animation per organizer, and assume it only organizes in one Task. Now, we register per organizer Task if there is a rule that supports split in the Task width. Bug: 207720388 Test: atest WMJetpackUnitTests Change-Id: Iac4e10af9aa0e7846c81b036b2cf708b6cbe627e
* Allow checking if an activity is organizedAndrii Kulian2021-12-081-0/+13
| | | | | | | | | | Adds an interal method to check if an activity is being organized by any process. This can be used by WM Jetpack Extensions APIs to inform apps about their activities being embedded. Bug: 204399167 Test: Manual, using demo app Change-Id: I3a0ad021ad43c97bf9b92df05e9858aae143f62b
* Remove TaskFragmentAppearedInfoChris Li2021-11-191-3/+2
| | | | | | | | | We don't really have any use case to manipulate TaskFragment leash, and removing it can reduce chance for related security issue. Fix: 207061678 Test: pass existing Change-Id: I24617228991f030335ba74ce7c2ee48b9c33b9d6
* Allow TaskFragmentOrganizer to set remote animationChris Li2021-08-271-0/+29
| | | | | | | | | | When all windows in the transition is belong to organized TaskFragments, have the TaskFragmentOrganizer to control the animation on client side. Bug: 196173550 Test: atest WmTests:TaskFragmentOrganizerControllerTest Test: atest WmTests:AppTransitionControllerTest Change-Id: I835467e23863286a5bd34380424cc9eca2c7372f
* Promote TaskFragment APIs to TestAPiCharles Chen2021-07-261-3/+11
| | | | | | | | | | | ... to verify their behaviors in CTS Also wraps ITaskFragmentOrganizer to TaskFragmentOrganizerToken because we cannot make .aidl a TestApi. Test: presubmit Bug: 192442647 Change-Id: I848a33340449189af7d9d66a6468a9e397a0f53a
* Allow TaskFragmentOrganizer to apply WCT without permissionChris Li2021-07-151-0/+13
| | | | | | | | | | TaskFragmentOrganizer will be used by regular apps without the permission to manage Task. We are allow it to apply transactions if it is operating on TaskFragment that is organized by itself. Bug: 193191599 Test: atest WmTests:TaskFragmentOrganizerControllerTest Change-Id: I82e5d49260680bd496ff184c6795ec817c65d858
* Add unit test for TaskFragmentOrganizerChris Li2021-07-101-0/+4
| | | | | | Bug: 190433129 Test: atest WmTests:TaskFragmentOrganizerTest Change-Id: I1665921c4ec27fa3e08f250fc639e290977298c2
* Add onErrorCallback for TaskFragmentOrganizerChris Li2021-07-011-0/+35
| | | | | | | | | | | | | | When app wants to create activity through sidecar (for example, startActivityToSide), we need a callback in case it failed to finish the request. Allow the caller to set a token for the WCT, which will be passed back if there is any error, so that the caller can identify the error callback. Bug: 190433129 Test: N/A Change-Id: Icffb7255e75465b90ed822559296f147a7e3418a
* Add TaskFragmentOrganizer APIChris Li2021-06-221-0/+131
Mainly the API surface. Bug: 190433129 Test: N/A Change-Id: I426b7fdbe62d58213c5e49a4773dd5fda0eb4dfe