summaryrefslogtreecommitdiff
path: root/core/java/android/window/WindowContainerTransaction.java
Commit message (Collapse)AuthorAgeFilesLines
* Enable overriding density for desktop tasksAts Jenk2023-03-131-0/+13
| | | | | | | | | | | | | | | | | | Add a new API to WindowContainerTransaction to support updating the container density. This allows us to update the configuration object with a new density value that would get applied by the WindowOrganizerController. Allow list density changes in WindowOrganizerController as an allowed configuration change. Update DesktopTasksController to change the density value when moving a task to desktop or back to fullscreen (if enabled). Use system property persist.wm.desktop_mode_density to override the density for desktop tasks. Allowed range for the density override is 100 to 1000. Bug: 272529050 Test: atest DesktopTasksControllerTest Change-Id: I96539176252fdd5b69b02e3bd1b6a4231990decb
* Pass TaskFragmentAnimationParams to TaskFragmentChris Li2023-01-051-1/+51
| | | | | | | | | | | | | Pass the animationBackgroundColor set in WM Jetpack to WM Core through TaskFragmentAnimationParams. Introduce TaskFragmentOperation for all the future TaskFragment related WindowContainerTransaction operations. Bug: 263047900 Test: atest WmTests:TaskFragmentOrganizerControllerTest Merged-In: Ia8da5ea7cb6a9ba0615b77ba06b16339d78c11fd Change-Id: Ia8da5ea7cb6a9ba0615b77ba06b16339d78c11fd
* [RESTRICT AUTOMERGE] WCT#setReparentLeafTaskIfRelaunchJeff Chang2022-12-061-0/+41
| | | | | | | | | | | 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
* Merge "Move the task to back while pressing back on the last activity" into ↵Louis Chang2022-11-171-0/+32
|\ | | | | | | tm-qpr-dev
| * Move the task to back while pressing back on the last activityLouis Chang2022-11-161-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... 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
* | Add WCT#setDragResizing to optimize fluid resizingJorge Gil2022-11-111-0/+36
|/ | | | | | | | | | | | | Allows WM Shell to indicate the start/end of drag resizing, which core can use as a signal to reuse a single (larger) surface size for the entire drag resize operation to avoid continuous buffer allocations after each size change. Bug: 249808500 Test: drag resize a freeform window, verify WindowLayout requests a fullscreen sized surface; atest TaskPositionerTest Change-Id: I27e2b44270d7ea4f701fa8037f93b20dc691284b
* Allow ActivityEmbedding to finish Activity through WCTChris Li2022-09-231-0/+20
| | | | | | | | | | | | | | | 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
* Merge "Add TaskFragmentOrganizer#applyTransaction with request transition" ↵Chris Li2022-09-011-4/+2
|\ | | | | | | into tm-qpr-dev
| * Add TaskFragmentOrganizer#applyTransaction with request transitionChris Li2022-09-011-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Move Task Close to WindowContainerTransaction" into tm-qpr-devMaryam Dehaini2022-08-311-0/+21
|\ \ | |/ |/|
| * Move Task Close to WindowContainerTransactionMaryam2022-08-301-0/+21
| | | | | | | | | | | | | | | | | | Added removeTask HierarchyOp so that CaptionWIndowDecorModel now uses WindowContainerTransaction to remove task rather than IActivityTaskManager#removeTask(int) Bug: 242094334 Test: Manual testing using acloud and unit testing (atest WmTests:WindowContainerTransactionTests) Change-Id: I9e2f1946a517bdba6a75b7049f00943d729045f0
* | Make WCT#requestFocusOnTaskFragment a TestApiChris Li2022-08-261-1/+0
|/ | | | | | | | So that we can verify the API in CTS. Bug: 232476698 Test: CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerPolicyTest Change-Id: I0e064f8cae48cc0281a0b462b8d072baceeeca9f
* Merge "Handle alwaysOnTop in DisplayAreas." into tm-qpr-devGaurav Bhola2022-08-121-0/+53
|\
| * Handle alwaysOnTop in DisplayAreas.Gaurav Bhola2022-08-041-0/+53
| | | | | | | | | | | | | | | | | | | | - 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
* | Add setForceTranslucent APITony Huang2022-08-081-0/+30
|/ | | | | | | | | | | | | | | | 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
* Handle the uncontrolled task in split-screenJeff Chang2022-07-081-2/+4
| | | | | | | | | | | | | | | | | | 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
* [DO NOT MERGE] Fix founction not found on tm cts testsTony Huang2022-06-071-0/+13
| | | | | | | | | | | We refactor setAdjacentRoots function on tm-qpr but cts suite is still using tm branch and it lead to it cannot found previous function. Add a temp function params same as old one on tm-qpr only for pass tests. Fix: 235169332 Test: atest MultiWindowTests on tm-dev codebase Change-Id: I3eaea698089cec78ef7fcef17817317c55a7bfe6
* Remove the special logic of the divider bar z-orderingTony Huang2022-05-201-27/+4
| | | | | | | | | | | | Remove the divider bar z-ordering logic since the divider bar is attached to a single-top root task for split screen now. Remove split anchor too because it is for legacy split screen using. Also removed corresponding tests which are no longer needed after this patch. Bug: 199236198 Test: pass existing tests Change-Id: I3435a3c81de78804c8110eb38bbacd0a23b391ef
* Keep the focus on the primary when launch ActivityEmbedding placeholderChris Li2022-04-241-0/+23
| | | | | | | | | | Default focus should be on primaryActivity when a placeholder is shown. This is a short term improvement as focus navigation works from primary to secondary but not in reverse. Fix: 229138140 Test: atest WmTests:TaskFragmentOrganizerControllerTest Change-Id: Ic4e2280e4b37a8fa04fc532245a5d0cfa4e5e012
* Remove some functions @hide in WindowContainerTransactionTony Huang2022-04-131-4/+0
| | | | | | | | To using these function in CTS tests, we need to remove @hide. Bug: 229024233 Test: build pass Change-Id: I7102918593ef8886888604492e39c1f952408ec7
* Pass through Recent's finish-but-not-really intentEvan Rosky2022-03-221-0/+15
| | | | | | | | | | | | | | | There are a few situations where recents will tell WMCore that it is finishing (going home), but then actually doesn't finish. In these cases, we need to tell WMCore not to enter PiP even when it normally would. This functionality is added to shell-transitions by adding a signal to WindowContainerTransaction. Bug: 223317893 Bug: 223317556 Test: open pipable, go to recents, swipe pipable to close. Change-Id: I969ae8b562aa54fc06e35164e676205682f24994
* Add client API to add/remove insets-provider.Gaurav Bhola2022-03-011-0/+104
| | | | | | Test: atest WindowOrganizerTests Bug: 199449177 Change-Id: I9cc0541e4fa930775ee49cd52cbe6c2c728b4d78
* Support restoring the original task ordering of transient-launchesEvan Rosky2022-02-231-0/+19
| | | | | | | | | | | | | | | | Like legacy recents, we need to be able to restore the home task back to where it was in the task-ordering when recents doesn't actually switch to home. This CL records the "restore-below" task during activity-start and stores in the associated transition. There is a new WCT op that will "restore" a container back to where it was. Bug: 210014802 Test: launch a task chain (task followed by task), then go to recents, then restore the top task. observe task order remains as it was before recents. Change-Id: I9f9da7d35ffe69099e6431b7a0d5a527e33c5a74
* Add support for launching a shortcut in WindowContainerTransactionEvan Rosky2021-12-091-0/+55
| | | | | | | | | | | | | Some shell actions require the ability to launch a shortcut either in a transaction and/or with other window operations (eg. Bubbles and Split-screen). This required changes to LauncherAppsService to support forwarding the caller information internally from systemserver. Bug: 209073176 Test: existing LauncherAppsService tests still pass Change-Id: I11893abca24cab0b899c3385af0ca46932bcc9e3
* Merge "Move adjacent tasks forward together to ensure occluding state" into ↵TreeHugger Robot2021-12-021-4/+28
|\ | | | | | | | | | | | | | | sc-v2-dev am: 642ead3a05 am: 46be27b4eb Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16220664 Change-Id: Ie9bf6943cfc218a2c7845ce13241eaf854e07301
| * Move adjacent tasks forward together to ensure occluding stateJerry Chang2021-12-021-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | In multi-window split, if one of the adjacent task are moved to front, we need to move another one forward to ensure all the other tasks will be occluded by these adjacent tasks as expectedly. Add a flag to distinguish whether to move the adjacent tasks together when setting adjacent tasks. Fix: 204130085 Test: atest TaskTests Test: atest WMShellUnitTests Change-Id: I34ccd2633b23425a978bd3df4acc50f17323de21
* | Merge "Make split screen only reparent top task" into sc-v2-dev am: ↵Tony Huang2021-10-151-10/+56
|\| | | | | | | | | | | | | | | be0c2bdc92 am: 93083fa0a7 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937026 Change-Id: I0375cd74189783fcd9b94d526c42ee69b55dde7e
| * Make split screen only reparent top taskTony Huang2021-10-141-10/+56
| | | | | | | | | | | | | | | | | | | | | | Follow latest split screen UX model, it should only reparent the top task to split for app-pair model. Fix: 201480664 Bug: 202740040 Test: manual Test: pass existing tests Change-Id: I4b360a31ce8e7366a77216a94b5f1b19bba848e9
* | Merge "Replace untyped Parcel read/write"Hao Ke2021-09-161-3/+3
|\ \ | |/ |/|
| * Replace untyped Parcel read/writeHao Ke2021-09-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: Replaced `Parcel.readList()` call with empty classLoader. Calling `Parcel.readList(,null)` could be dangerous as an attacker can abuse the call to deserialize arbitrary parcelables. To avoid such an attack vector, we should switch in using `Parcel.readTypedList()` instead. Test: atest CtsInstantAppTests Test: atest CtsWindowManagerDeviceTestCases:MultiWindowTests Test: atest RemoteTransitionTest Test: Boot and observe systemUI works Bug: 195622897 Change-Id: I7c8cb23f6f3d26b1d4d47696e70982797b5f0210
* | Promote #setAdjacentTaskFragment to TestApiCharles Chen2021-09-101-11/+23
|/ | | | | | | | | | Also rename TaskFragmentAdjacentOptions to TaskFragmentAdjacentParams to make metalava happy. Test: build & run Bug: 192442647 Change-Id: Iab256ce8c745635a51834f44e72493e204224f36
* Prevent activity being destroyed immediately if embeddedLouis Chang2021-08-231-1/+51
| | | | | | | | | | | | | | | | The embedded activity was destroyed immediately when being finished because the next top activity was on the adjacent TaskFragment and was already visible. Therefore, the finishing animation was played before the organizer requested to finish the activity on the adjacent TaskFragment. Prevent the last activity of the embedded TaskFragment to be removed immediately if the organizer requested to. Bug: 189386466 Test: finish both activities on separate TaskFragments Change-Id: I916eddc4dcf0de3bc7ed7264296f441d1b7bb726
* setAdjacentTaskFragments for paired TaskFragmentChris Li2021-07-301-2/+4
| | | | | | Bug: 190433129 Test: Tested with sample app Change-Id: Ifa4cf3df77f053d2f5806290989329d3a2b47160
* Promote TaskFragment APIs to TestAPiCharles Chen2021-07-261-6/+0
| | | | | | | | | | | ... 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
* Add WCT#setAdjacentTaskFragmentsChris Li2021-07-231-2/+30
| | | | | | | | | Similar to WCT#setAdjacentRoots, but can be called with fragmentTokens in case the TaskFragments may not be created yet. Bug: 190433129 Change-Id: I41dd515fb9722ea6e95d0c3fb040cc0d196ad78d Test: atest WmTests:TaskFragmentOrganizerControllerTest
* Providing caller's token when starting activity in TaskFragmentLouis Chang2021-07-231-2/+9
| | | | | | | | | NEW_TASK flag was added by ATMS when #startActivityInTaskFragment is called because the activity was started without source record. Bug: 193846941 Test: starting CCT in sample app Change-Id: Ida26034324f7ff761f1e688403d78959a01f010d
* Create a LegacyTransitions to manage combined WCT + remoteanimationEvan Rosky2021-07-161-0/+40
| | | | | | | | | | | Use this to implement Drag-to-split transition BYPASS_INCLUSIVE_LANGUAGE_REASON=using existing API. Bug: 192291727 Test: drag from taskbar into split and observe. Also, drag same-app into split and observe no-op. Change-Id: I710805c85c7d57ae8eebe18e5df7fca899f1b882
* Allow TaskFragmentOrganizer to apply WCT without permissionChris Li2021-07-151-4/+47
| | | | | | | | | | 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 onErrorCallback for TaskFragmentOrganizerChris Li2021-07-011-1/+36
| | | | | | | | | | | | | | 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
* Implement WCT#create/deleteTaskFragmentChris Li2021-06-221-6/+93
| | | | | | | | | | Also update setAdjacentRoots to accept TaskFragment. Pass the WCT to WM Core. The implementation on WM Core side will be in a separate cl. Bug: 190433129 Test: N/A Change-Id: I1ee8a7ba0a43e18e180c05a7fcf0467967564782
* Add WindowContainerTransaction APIs for create/deleteTaskFragmentChris Li2021-06-221-0/+71
| | | | | | | | | This change contains mainly the function signatures and data classes. The actual implemenation will come in a separate cl. Bug: 190433129 Test: N/A Change-Id: I4f9695cea270cc06f2f6b1a2c56245cd2a43b9fd
* Add Builder for WindowContainerTransaction#HierarchyOpChris Li2021-06-181-32/+120
| | | | | | | | Refactor it as we are adding more options. Bug: 190433129 Test: just refactor Change-Id: I316899427c1c8e12d97fd5f018c455a246da30bb
* Support FLAG_ACTIVITY_LAUNCH_ADJACENT for launch root with adjacentJerry Chang2021-04-271-0/+39
| | | | | | | | | | | | | | | Add window container transaction APIs to indicate launch root for task launching with FLAG_ACTIVITY_LAUNCH_ADJACENT. If launch adjacent flag root is available, consider to launch to its adjacent task if the launch is coming from the same root task. Fix: 169271875 Test: atest WMShellUnitTests Test: atest TaskDisplayAreaTests Test: manual test FLAG_ACTIVITY_LAUNCH_ADJACENT behavior with adjacent root. Change-Id: I1716aaa48745d2c32cd413c8eac0b1d17810f0de
* Support PiP with fixed rotationRiddle Hsu2021-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 2 cases with rotation change: (a) Enter PiP from fullscreen. http://recall/-/d6GxE5mVL8Ww2IPnx7Nk0o/hDfmdrhrBFjJNOdi1s66OW (b) Launch fullscreen app with the existing PiP. http://recall/-/d6GxE5mVL8Ww2IPnx7Nk0o/bUpHZ6Sh98zKZJnRM7oFy9 Steps of (a): 1. Task#setWindowingMode to PiP. If the next fullscreen activity will change display orientation, start fixed rotation on it. And start deferring orientation change. 2. PipTaskOrganizer#onFixedRotationStarted is called to mark it will be a special case. 3. PipTaskOrganizer#onTaskAppeared is called and starts the PiP rotation animation by animateResizePip with rotated destination bounds from rotated DisplayLayout. 4. When onPipAnimationEnd, use WCT#scheduleFinishEnterPip to notify that the animation is done, so the deferred orientation change can continue to update (PinnedTaskController#setEnterPipBounds). The end transaction of animation (reset matrix) is deferred until fixed rotation is finished. Also freeze the PiP task configuration one time, to avoid extra configuration change (letterboxed) by rotation change. 5. The seamless rotation starts, the PiP surface is transformed to previous rotation based on the bounds of previous step. So the PiP task can show the same orientation as rotated display. The frozen flag of PiP task configuration is cleared. 6. PipTaskOrganizer#onFixedRotationFinished is called. The final PiP destination bounds and the deferred transaction of step 4 will be sent to WM. Steps of (b): 1. Fixed rotation happens (PipTaskOrganizer#onFixedRotationStarted) when there is an existing PiP. Apply fade-out animation. 2. PipTaskOrganizer#onMovementBoundsChanged is called to update rotated destination bounds. 3. PipTaskOrganizer#onFixedRotationFinished is called to apply fade-in animation with new bounds. Other changes: - WCT#scheduleFinishEnterPip was used to set bounds and notify windowing mode change. That is already done by other config change oepration of WCT. So this redundant operation is changed to be a signal to notify that the PiP animation is done. - Ignore calculating letterbox bounds for PiP activity because it should fill the task. - Add PinnedTaskController#DEFER_ORIENTATION_CHANGE_TIMEOUT_MS to avoid using alpha animation after swiping from any task. - Consider source rect hint with rotation. Bug: 165794724 Bug: 175836469 Test: DisplayContentTests#testFixedRotationWithPip PipAnimationControllerTest#pipTransitionAnimator_rotatedEndValue Change-Id: I2c26b5d93996193caaf020bd0e2314c8e1789545
* Add task-launch support to WindowContainerTransactionEvan Rosky2021-03-301-7/+47
| | | | | | | | | | This enables launching multiple tasks (recent tasks) within one transaction simultaneously with configuration and hierarchy changes. Bug: 182002789 Test: WindowOrganizerTests#testStartTasksInTransaction Change-Id: Ic297eeae52e833286e7feede73d91354a5394e7c
* Fixed some bugs with main/side stage splitsWale Ogunwale2021-01-251-0/+5
| | | | | | | | | | | | | - Dragging to right to dismiss no working. - Dragging to left to dismiss closes all apps - Not able to put app in split after left drag to dismiss - Pressing back on last activity in one split dismisses both. - Don't move home task forward when startActivityFromRecents with launch root set. Fixes: 176061049 Test: they pass! Change-Id: Ic1219b747e995ee8833b31433356bd44435118da
* WindowContainerTransaction for setting adjacent rootsWale Ogunwale2021-01-201-0/+29
| | | | | | | | | | | | | Ability to specify that 2 root tasks are adjcent there by allowing them to occlude their parent. Similar to how the legacy primary/secondary split windowing modes are used to occlude their parent. Also, occlude parent if a child in multi-window mode as a matching bounds. Bug: 177166639 Test: AppConfigurationTests#testSplitscreenPortraitAppOrientationRequests Change-Id: I7d54bfa188700a76b0bca911d2011123c21553ad
* Support WCT#reparentTasks and WCT#setLaunchRootWale Ogunwale2021-01-111-15/+126
| | | | | | | | | Allows for bulk reparenting of tasks from one container to another and also setting launch root in the same call to wm-core. Bug: 175416931 Test: CTS and split-screen tests pass! Change-Id: I362f89bc0ccc14e4152a2040a7198fd542ffe4d5
* Support ignoring orientation request on DisplayArea levelChris Li2020-10-131-4/+4
| | | | | | | | | | | | | | | | | | | | | 1. Move the mIgnoreOrientationRequest to DisplayArea so that one can set it on DisplayContent and DisplayAreaGroup to ignore orientation request from non-app windows. 2. Have the DisplayContent to return SCREEN_ORIENTATION_UNSPECIFIED when it is SCREEN_ORIENTATION_UNSET so that the display respects sensor rotation. 3. Move the logic of using last orientation back to TDA, otherwise when TDA returns UNSET because ignore is set, DC may incorrectly uses the last orientation. Bug: 170725334 Bug: 155431879 Test: manual: test with setting TDA and DC to ignore Test: atest WmTests:TaskDisplayAreaTests Test: atest WmTests:WindowOrganizerTests Test: atest WmTests:DisplayAreaTest Test: atest WmTests:DisplayContentTests Change-Id: Ie92b059c453204799a58efd39dc9b23f7d62816d
* Add option to always ignore orientation requestChris Li2020-09-221-0/+35
| | | | | | | | | | | | | | | | | (2/n Orientation on DisplayAreaGroup) When the option is set to true, the TDA will ignore all the fixed-orientation request from apps. This can be used on duo display device, so that the logical display will not be rotated when launching a fixed-orientation app on one of the display. Bug: 155431879 Test: manual: test with dual-display-area policy Test: atest WmTests:TaskDisplayAreaTests Test: atest WmTests:WindowOrganizerTests Change-Id: I3f0ea1415523926195b51fe28744974a9b64d803