Enforce max size for resizing operations.

Previously, maxVisibleSize is only enforced when we want to preserve
orientation. However, we should enforce it when in complete freeform
also.

Even for preserve orientation case, since it calculates two possible
rectangles and grab the bigger one if it's a grow operation, it's
possible the bigger rectangle is beyond the max possible size. By
setting the limitations early, this will no longer happen.

Bug: 154936459
Bug: 155433395
Test: Drag-resize a window that has a max size set (PIP window), and now
it is properly constrained.
Test: atest TaskPositionerTests

Change-Id: I3e9bc615554561e035a5c7110d0400687c6ba365
1 file changed