Explicitly set X and Y values when offsetting split tasks

* Race condition where DeviceProfile that gets set on
TaskViewSimulator initially has incorrect values
(dp.isLandscape is incorrect)
* The correct one eventually gets set, but in the meantime
we set the split offset assuming in incorrect value in
PagedOrientationHandler#setLeashSplitOffset()
* Once corrected, we weren't removing the old offset
that was set. Now we ensure only either an X or Y offset set.

Bug: 199376724
Test: Enter split, rotate device and quickswitch.
Both tasks should be visible throughout the gesture

Change-Id: I9fa44642ab440a0200c0b0eb9b37574e47b7100d
This commit is contained in:
Vinit Nayak
2021-09-09 16:23:55 -07:00
parent 2d9741b832
commit 6835115c13
2 changed files with 7 additions and 5 deletions

View File

@@ -503,9 +503,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
if (dp.isLandscape) {
splitOffset.x = splitInfo.leftTopBounds.width() +
splitInfo.visualDividerBounds.width();
splitOffset.y = 0;
} else {
splitOffset.y = splitInfo.leftTopBounds.height() +
splitInfo.visualDividerBounds.height();
splitOffset.x = 0;
}
}
}