Update display size before updating 'ignore orientation request'

When folding/unfolding a foldable device 'ignore orientation request'
flag might be updated in DisplayContent because different displays
might have different properties. This might result into updated
display rotation.

This flag is updated in 'applySettingsToDisplayLocked' and the new
rotation might be applied in the same method. But DisplayRotation is
not updated with the new display size when applySettingsToDisplayLocked
is invoked. This caused calculation of incorrect rotation
(using old display dimensions).

Fixed by updating display rotation settings only after
updating the size of the display.

Fixes: 203844967
Test: open portrait only app on the unfolded screen,
  fold the device => app is still in portrait orientation
Test: open rotatable app on the unfolded screen,
  fold the device => app is in portrait orientation
Test: rotate screen on inner/outer screen of a foldable device
Change-Id: Ie408ebe7e5913b4a1f97d46581d693e56efaf46c
5 files changed