Use windowMetrics to determine window bounds.

The test retrieves a previous orientation, makes the Activity
request the rotated orientation, and then expectes a call
to OnConfigurationChanged(). It uses DisplayInfo, which returns the
bounds of the real display instead of the DisplayArea's. This will cause
the test to fail on devices where the real display orientation and the
DisplayArea orientation differ.
Solution: Replace DisplayInfo.logicalWidth/logicalHeight with
WindowManager#getCurrentWindowMetrics, which returns the bounds of
the window. This way there is consistency with devices
implementing DisplayAreas.

Bug: 231899419
Test: cts-tradefed run commandAndExit cts --module CtsAppTestCases

Signed-off-by: Jimmy Chang <jimmychang@microsoft.com>
Change-Id: I7f5d0fe02cee2c4057beada7944b244af7134e32
2 files changed