summaryrefslogtreecommitdiff
path: root/core/java/android/window/WindowOrganizer.java
Commit message (Collapse)AuthorAgeFilesLines
* Re-enforce MANAGE_ACTIVITY_TASKS for applySyncTransactionChris Li2023-03-281-5/+2
| | | | | | | | | | | The conditional permission was introduced for TaskFragmentOrganizer, but not really needed. Remove the conditional check. Bug: 259938771 Test: pass existing tests (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:65ac64c3476f42f8437481bff77485f53ab4f391) Merged-In: I666b9ee6b6076766513b97e675fdbaa002428601 Change-Id: I666b9ee6b6076766513b97e675fdbaa002428601
* Make startTransition one-wayRiddle Hsu2022-09-271-4/+17
| | | | | | | | | | | | | | If shell is starting an existing transition, it doesn't need the returned transition token so it can be an async call then it won't block shell's thread to execute other operations. If shell is starting a new transition, then use the new added 2-way startNewTransition which is the same as the original path. Bug: 248550757 Test: atest ShellTransitionTests Test: CtsWindowManagerDeviceTestCases with shell transition Change-Id: I5f64d19475d5b857a461775dd6f3002567e93ad8
* Migrate screen rotation latency tracker with shell transitionRiddle Hsu2021-10-191-1/+13
| | | | | | | | | | | | | | | | | | It was done by WMS#startFreezingDisplay~stopFreezingDisplayLocked. The duration is measured from rotation change to start animation. Add a remote callback to know when the rotation animation is started. So WM core can have the paired begin/end of trace that matches the latency exactly. The added ITransitionMetricsReporter is available for any processes. So in the future it can also report the metrics from remote animator. This change focuses on the rotation animation handled by shell. Bug: 199836343 Test: adb shell setprop persist.debug.shell_transit 1; reboot Rotate display and check trace "L<ACTION_ROTATE_SCREEN>". Change-Id: I180d2fe1a77e98b6427ba831a2db2593739376bd
* Create a LegacyTransitions to manage combined WCT + remoteanimationEvan Rosky2021-07-161-0/+22
| | | | | | | | | | | 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-3/+16
| | | | | | | | | | 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
* Take PIP snapshot in the shell and use bounds state size for crossfadingjorgegil@google.com2021-05-171-23/+0
| | | | | | | | | | | | Since the width/height of the SC should not be used anymore, we'll use the pre-resize bounds to scale the surface before animating the crossfade. Bug: 186669773 Test: Enter PIP in seamless resize demo, resize with seamless turned off uses a crossfade animation with the correct size Change-Id: I1405be9208ac9e7cc34283e3d97dc431f0cb643c
* Fixed some bugs with main/side stage splitsWale Ogunwale2021-01-251-1/+3
| | | | | | | | | | | | | - 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
* Deprecate MANAGE_ACTIVITY_STACKS permissionLouis Chang2020-10-281-6/+6
| | | | | | | | | | | Adding MANAGE_ACTIVITY_TASKS permission as the replacement, but still grant the deprecated MANAGE_ACTIVITY_STACKS permission for app compatibility. Bug: 157876448 Test: presubmit Change-Id: I894ee66e058b1024a731d3be4b33b69626451f08
* Scaffolding for Shell TransitionsEvan Rosky2020-09-301-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial rough implementation of Shell Transitions. Shell Transitions can be enabled by setting ENABLE_SHELL_TRANSITIONS via `adb shell setprop persist.debug.shell_transit 1` The main structure behind this is: - TransitionController in Core responsible for handling the collection of transition participants and communicating with the TransitionPlayer in Shell. - Transitions in Shell responsible for starting transitions and playing associated animations. This initial version only supports task open/show/close and does a simple fade. The flow is: 1. activityStarter calls to Transitions.requestStartTransition 2. Transitions will prepare to start and then call WindowOrganizerController.startTransition(). 2. Various operations in Core call TransitionController.collect() to track participants. This collect() acts as a replacement for adding to mOpening/ClosingApps. 3. The legacy executeAppTransition() is wired into TransitionController.setReady() for now. This signal is used to ready a BLASTSyncEngine. 4. When all participants are done drawing, TransitionController will commit any showing visibility changes and then will construct a TransitionInfo object summarizing all the changes needed for animation. This gets sent to Transitions.onTransitionReady() 5. Transitions then plays the transition animation and on completion will call WindowOrganizerController.finishTransition() which will tell TransitionController to do any finishing work (like commiting deferred hide changes). Bug: 161980187 Test: enable the flag and try opening/closing tasks. Also added TransitionControllerTests Change-Id: I80c3a241fc12004a894c26523a1e5828e0c533ff
* Make WindowOrganizer and TaskOrganizer non-staticHongwei Wang2020-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to allow unit test against TaskOrganizer, WindowOrganizer for interations between Shell and WM core. To test on WM side ``` when(mWindowOrganizer.getWindowOrganizerController()) .thenReturn(mockedWindowOrganizerController); when(mockedWindowOrganizerController.getTaskOrganizerController()) .thenReturn(mockedTaskOrganizerController) doSomeTest(); verify(mockedWindowOrganizerController).somethingHappended(); verify(mockedTaskOrganizerController).somethingHappended(); ``` To test on Shell side ``` ShellTaskOrganizer organizer = new ShellTaskOrganizer( mockedTaskOrganizerController) doSomeTest() verify(mockedTaskOrganizerController).somethingHappended(); ``` Removed also - Singleton pattern in TaskOrganizer and DisplayAreaOrganizer as it's redundant to what's in WindowOrganizer - static getController methods in both TaskOrganizer and DisplayAreaOrganizer as we prefer non-static for testability - static methods in TaskOrganizer in general - static methods in WindowManagerProxy in general Bug: 161711455 Bug: 149338177 Test: make sure everything still works Test: atest WmTests:WindowOrganizerTests \ WmTests:DisplayAreaOrganizerTest Change-Id: I978d20c7b87e73d0f6d22f7ab08188e4d12d745c
* Added takeScreenshot API to WindowOrganizerchaviw2020-04-231-0/+24
| | | | | | | | | | | | | | Added requests to take screenshot of a Window that's organized by the client. The resulting screenshot will be attached to a SurfaceControl and reparented to the requested window's parent. The client will be responsible for showing, setting z order, etc. They can also re-parent to another place in the hierarchy. The default is to parent to the window's parent since that's usually where a screenshot is placed. Test: Builds Bug: 152114574 Change-Id: I5c829e029f3528fdb382842e9f0474097e01cb2e
* Add TestApi interfaces for window organizersWale Ogunwale2020-04-011-147/+18
| | | | | | | | Enables testing the API surfaces from CTS. Bug: 149338177 Test: they pass! Change-Id: I7e1f2852585a10c20d299bd87e9a87f828d06d6a
* Add task organizer based task embedderWinson Chung2020-03-301-0/+10
| | | | | | | | | | | | | | - Split TaskEmbedder into its current VirtualDisplay implementation and an implementation that uses task org to create and manage the task - Use the task org embedder implementation in separate bubble task view - Skip task org tasks from triggering task resizing - Add task org callback for back press on task root if requested Bug: 148977538 Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest Test: atest WmTests:TaskOrganizerTests Change-Id: Id422bb2547197c617f914ed7cf5085e02a1c3fb5
* Introduce DisplayArea organizerWale Ogunwale2020-03-241-0/+44
| | | | | | | | | | | Similar to task organizer this allows for the organization of display areas. Test: they pass! Bug: 147406652 Bug: 152113464 Bug: 152117221 Change-Id: Id0dbec20f0aedc5162f4ff7be81b2dafb0c8f3c9
* Introduce WindowOrganizerWale Ogunwale2020-03-231-0/+157
WM currently only allows the organization of tasks, however we will soon be allowing the organization of DisplayAreas. To help with the code structure, we are introducing WindowOrganizer interface which will contain common APIs for all types of windows organizers (e.g. applyTransaction) and also be the interfaece for getting the controller for other organizers. Test: they pass! Bug: 147406652 Bug: 152113464 Bug: 152117221 Change-Id: Id2797b288ce92430206c25345d60e7b0e3be98c8