summaryrefslogtreecommitdiff
path: root/core/java/android/view/WindowLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* Refine the way of calculating insets for configuration (1/3)Yunfan Chen2022-08-241-9/+9
| | | | | | | | | | | | | | | | | | | The original patch reverted as commit bc0d5539e6ce80bb686dd38f6517f9c2dcd77aa0. This patch only includes the part of refactors to make the calculation of configuration around insets easier. The actual change of making extra navigation bar treated as navigation bar and the fix of the UiDevice in ui automator is in a separate patch to avoid being blocked and blocking other changes for long. Test: PlatformScenarioTests Test: TaplTestsQuickstep, ThemeIconsTest, TaplTestsLauncher3 Bug: 238981445 Bug: 238985243 Bug: 238581838 Bug: 233945217 Change-Id: If966bcc8125300d47d5cd631f7db17ff027e5261
* Revert "Reland "Make extra navigation bar count towards non decor frame"""Sam Dubey2022-07-151-9/+9
| | | | | | | | This reverts commit 620e91578cb5d0bbfbf6f8c5aedb77e23c13ef49. Reason for revert: b/238985243 Change-Id: I1fc82c61b445b6f5ceedb2ec8b727e8e745f47c9
* Reland "Make extra navigation bar count towards non decor frame""Yunfan Chen2022-07-131-9/+9
| | | | | | | | | | | | | | | | | | | This reverts commit 8626ad35b186d20a67bdb30119c4837fc08bff25. Reason for revert: Trying to reland The previous patch may delay a configuration update caused by the task bar change, and dispatch the update when something irrelevant happens such as dragging an icon to the workspace. Changed logic in WMS and WindowState to ensure a configuration update in that case. Test: TaplTestsQuickstep#testAllAppsFromHome (With task bar) Test: CtsWindowManagerDeviceTestCases (With task bar) Test: android.view.cts.ViewTest Bug: 224404595 Bug: 205496695 Bug: 228380863 Change-Id: Ib192d4ad012fed136f808b15a84f8d83ca426b21
* Introduce InsetsSizeOverrideYunfan Chen2022-07-061-2/+2
| | | | | | | | | | | | This is to let the insets provider provide a different size to the given windowing typed window. This can completely replace the ime frame provider and the old ime frame provider is migrated. Test: The task bar can still provide correct IME insets Test: DisplayPolicyInsetsTests Test: WmTests Bug: 225200928 Change-Id: I5f8c4462cdc48011efda908e0337a86cbf2a417f
* Make sure to extend insets frame when the bar layout with cutoutYunfan Chen2022-06-271-12/+17
| | | | | | | | | | | | The private flag to let the layout system know the bar should extend its requested size by the cutout size is not included in the insets calculation, and the bar size will have a mis-match if they want to do so. To modify the calculation of the insets to make them match. Bug: 236101339 Test: See the bug Test: atest DisplayPolicyInsetsTests Change-Id: If76f3325196db7e8ab90d6dc56c9f67e0cd61ca9
* Send the attached frame to the clientTiger Huang2022-06-201-11/+9
| | | | | | | | | | | | | | | | | | | | The attached frame is the frame of the parent window that its child attaches to, as long as the child is not TYPE_APPLICATION_ATTACHED_DIALOG. It is a factor while computing the window frame. Previously, we let the child obtain the attached frame from its parent view root. However, if the parent and the child are not in the same process, it can be tricky. This CL sends the attached frame from the server to the client via ClientWindowFrames. In this way, the child can compute its window frame without having to accessing the parent view root. Bug: 161810301 Bug: 175861127 Test: atest ActivityRecordTests WindowLayoutTests Change-Id: Ia844a4c927027e305a56114216eaee2bf7933b1f
* Don't set extreme values of Integer to safe boundsTiger Huang2022-06-061-2/+10
| | | | | | | | | | | | This is to prevent getting unexpected results while calculating the width or height of the rectangle, due to the overflow. This CL defines the borders of the window layout with large enough integers, which are also the borders of the safe bounds. Fix: 227276622 Test: atest ConfigurationScreenLayoutTest#testScreenLayout Change-Id: Iee14e6de48f57be4999f64dbdce01815de88a9df
* Merge "Refine PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT" into tm-devTiger Huang2022-03-221-25/+15
|\
| * Refine PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUTTiger Huang2022-03-171-25/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - If a window has PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT, the final frame might be larger than the requested size, and we cannot use the requested lengths to compute the window frame. Because the window size will be the new requested size, we don't want to extend the window size again and again. - When we are checking if a frame is overlapped with the display cutout, we only need to check if displayCutoutSafe contains the frame. We don't need to check individual bounding rectangles. This also fixes an issue that the gestural navigation bar is not extended by the waterfall cutout because it doesn't have bounding rectangles. Bug: 203031262 Bug: 161810301 Test: Enable double cutout or waterfall cutout in developer options and see if the frame of navigation bar is correct when it is at the same side of the cutout. Change-Id: Ic8c090198c556f2dc3b2c0b8498c42e9ca18c795
* | Use ClientWindowFrames to collect frames computed by WindowLayoutTiger Huang2022-03-141-10/+9
|/ | | | | | | | | | | | | This is a step to move the window layout to the client side. ClientWindowFrames is used to carry window frames dispatched from the server to the client for now. Later, the window frames will be computed at the client side, and the frames will be sent to the server side via ClientWindowFrames. Bug: 161810301 Test: presubmit (no behavior change but only code refactors) Change-Id: I83d8cfff2432e09759ef5b3d5f3b21731fc71bff
* Introduce a private flag to extend frame with cutoutYunfan Chen2022-02-281-0/+31
| | | | | | | | | | | | | | | | | This patch introduced a new private flag PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_TO_CUTOUT to let the window extend it's requested window frame to contain the display cutout frame. This is useful for the case of navigation bar. Without it, the navigation bar may not have enough space to layout it's content when it's on the same side as the display cutout. With the flag set, the Navigation bar will have the requested size plus the navigation bar size as its frame. Bug: 203031262 Bug: 161689946 Test: See reproduce steps in b/203031262 Test: atest WindowLayoutTests Change-Id: Id1d6f09dc421b5f25e16e4aca6282b6deec2e8c4
* Let the client compute the surface size on its ownTiger Huang2022-01-241-0/+43
| | | | | | | | | | | | This is a step to move the layout logic to the client side. We won't obtain the surface size from the server then. This CL also moves the logic about adjusting the LayoutParams of wallpaper to the client side. Bug: 161810301 Test: presubmit Change-Id: I3a81e174035c67a285cab449c0701ee2fe6f6a24
* Move tests from DisplayPolicyLayoutTests to WindowLayoutTestsTiger Huang2021-12-211-1/+1
| | | | | | | | | | | | This is a step to move the layout logic to the client side. We won't have DisplayPolicy#layoutWindowLw then. This CL also renames computeWindowFrames to computeFrames because we already have "Window" in the class name. Bug: 161810301 Test: atest DisplayPolicyLayoutTests WindowLayoutTests Change-Id: I4162e39f0d2aa35141fbbc72e43decd2f3f491f0
* Move all the window layout logic to WindowLayoutTiger Huang2021-10-271-11/+134
| | | | | | | | | | | | | | | | | This CL removes redundant layout logic in computeFrame and moves all the window layout logic to WindowLayout. We don't need mContainingFrame in WindowFrames anymore. The goal in the future is to let the client side to invoke WindowLayout#computeWindowFrames, and then send the frames to the server. The server will only use the method to layout the insets source windows. Bug: 161810301 Bug: 175858823 Test: atest DisplayPolicyLayoutTests WindowLayoutTests DialogFrameTests ManifestLayoutTests ToastWindowTest Change-Id: I91aa8051970cb8f30f4c13849a4db79b16182075
* Move logic about computing window frames to the client sideTiger Huang2021-10-191-0/+152
This CL moves the logic about clipping window frames by display cutouts to the client side. Without this, the very first window frame might be incorrect, and that can make the framework dispatch the wrong insets to the app. This CL is also a step to layout windows at the client side, and introduces a new class, WindowLayout, which will contain all the logic about computing the window frame. For now, it only computes the display frame and the parent frame, but eventually, it will compute the window frame. Bug: 197245443 Bug: 161810301 BUg: 175858823 Test: 1. Steps in b/197245443 2. atest DisplayPolicyLayoutTests Change-Id: Icafe76112547f4558c7397a1fc5fd08d87639a4d