WindowMetricsTests: Record layout bounds in screen coordinates
This test previously directly compared the window bounds from
WindowManager#getCurrentWindowMetrics() (which returns bounds in the
display's coordinate space) and the layout bounds (in the window's
coordinate space).
For fullscreen windows like on phones, these are generally the same.
However, this is not true in freeform mode, where the floating window
does not necessarily have to be at (0, 0) in screen coordinates.
We convert the layout bounds to screen coordinates using the
View#getLocationOnScren() API. Then we can directly compare the
converted bounds to WindowMetrics's bounds.
Bug: 168783546
Test: atest android.server.wm.WindowMetricsTests
Change-Id: If8741e7322ef76312c536cf34f881992ff4d05d9
1 file changed