Use well defined API for testGetWindowVisibleDisplayFrame

Display#getWidth() and Display#getHeight() were defined to return a
so-called "activity display" size instead of the actual size of display.
Frameworks deprecated those API because they are very misleading so we
should use the well-defined Display#getRealSize() instead to verify the
behavior of new Android version.

In addition, WM team introduced a app compat feature that offers the
best estimate of window configuration to app context, so
Display#getWidth() and Display#getHeight() actually return values
adjusted by its window size now. See ag/9536366 for more details.

Bug: 161575218
Test: atest ViewTest#testGetWindowVisibleDisplayFrame with a freeform
window.
Test: atest ViewTest#testGetWindowVisibleDisplayFrame on crosshatch for
cutout.
Test: atest ViewTest#testGetWindowVisibleDisplayFrame on cf_x86_64_phone
for regular phones.

Change-Id: Ia36311adc45da3617666a89f3729722298d0a9ab
1 file changed