Rotate display layout if there is a delta present

We should be careful rotating a DisplayLayout in place
through requestStartTransition trigger path as
the DisplayChange in TransitionRequestInfo uses
ROTATION_UNDEFINED as default start and end rotation
values, while DisplayLayout only supports 0, 90, 180, 270.

This can cause issues since display layouts use their
internally cached mRotation as the startRotation instead
of the one provided by transitions leading to
non-zero delta degree calculations.

We should also avoid assuming in OnDisplayChangingListener
implementations that a rotation caused the display change.
So short-circuiting if so in pip1.PipController

It is still unclear how to exactly repro this case, since
at least generrally, we populate the rotation fields with
a non undefined value - even if the rotation is unchanged,
but this change should guard against the unlikely usage of
ROTATION_UNDEFINED.

Bug: 360907644
Bug: 360908318
Flag: EXEMPT bugfix
Test: N/A
Change-Id: If7ac78d4497b0774268b937d0f5aad0d4972ea53
2 files changed