Update HandleMenu coordinates and tests
Updates HandleMenu position calculation so that: 1) AdditionalSystemViewContainer can take a global x,y position, whereas before it needed pre-adjusted coordinates to adjust to default Gravity.CENTER gravity of the LayoutParams. By changing the params' gravity to TOP-LEFT, callers can send global (x,y) position without additional adjustments. 2) Removed marginStart from x value of the HandleMenu position when in fullscreen/split - as that is only intended for the freeform's menu (to provide separation from the task edge). In fullscreen and split this cause the menu to be slightly off-center. 3) Updated HandleMenuTests so: - As a result of (1), expected position values use coordinates relative to the display bounds, which is consistent with the test comments. So there won't be expected negative values. - Added resource overrides for width/height/margins, so that changing the real resources don't cause the test to fail, nor changing the device's density, which would resolve the real values (in dp) to different than expected px. - Updated flagged tests to use @EnableFlags, otherwise flagged tests may not run in presubmit if the flag is disabled and are prone to breaking. Bug: 349464246 Test: atest HandleMenuTests Flag: com.android.window.flags.enable_additional_windows_above_status_bar Change-Id: Iffde19fa49cf0db097b9dd4abf504289f2af823d
Loading
Please register or sign in to comment