Fix offset bounds cut off display cutout region
Root cause :
Previous refactoring OneHandedDisplayAreaOrganizer and count on
mDisplayLayout.getStableBounds() for the rotated bounds, however
the bounds was cut off the safe inset(DisplayCutout) region.
Solution :
a. Do not count on DisplayLayout.getStableBounds() API
b. handling bounds by Surface.ROTATION_{N} with below
Rotate policy: 0 <-> 90, 0 <-> 270, 180 <-> 90, 180 <-> 270
| fromRotation | toRotation | rotateBounds |
-------------------------------------------------
| ROTATION_0 | ROTATION_90 | True |
| ROTATION_0 | ROTATION_270 | True |
| ROTATION_180 | ROTATION_90 | True |
| ROTATION_180 | ROTATION_270 | True |
| ROTATION_90 | ROTATION_0 | True |
| ROTATION_90 | ROTATION_180 | True |
| ROTATION_270 | ROTATION_0 | True |
| ROTATION_270 | ROTATION_180 | True |
| Others | False |
c. Reset bounds while register and unregister DisplayAreaOrganizer
Test: atest com.android.systemui.onehanded
Test: atest SystemUITests
Test: atest OneHandedDisplayAreaOrganizerTest
Bug: 160763351
Change-Id: I458edfe77c45320cd0d5b6dba2397b7229bcb048
3 files changed