Fix regressions in PiP movement bounds handling

- When we return early when detecting when to skip applying the bounds
  the stored bounds and rotation weren't being updated
- In landscape, the addition of the nav bar inset in the bottom pushed
  the movement bounds to be out of range, which cause an incorrect
  offset to be calculated
- Simplified the logic to calculate the offset for the adjustment for
  IME and shelf -- keep track of the previous offset, check the previous
  movement+offset bounds with the next movement+offset bounds and only
  update if the PIP is currently between those two bounds
- Tweak to landscape policy, if there isn't enough space for the ime
  offset, then don't apply it as a part of the shift

Bug: 126199952
Test: Go to landscape + pip, open IME and dismiss IME and ensure the
      PIP is pushed off and restored correctly
Test: In portrait, test going from app/home/ime and verify that the right
      offsets are applied, and then if the stack is not in the bounds of
      the offset change, that it is not applied

Change-Id: I67eee7d321995f403137db940b06f685d0c919af
1 file changed