Fix flakiness in DockConfigChangeTests

This CL fixes the two causes of flakiness indentified through locally
running the test.

The first is that setting the rotation right after creating the managed
RotationSession does nothing. It's possible this is because creating
the RotationSession modifies some settings and attempting to set the
rotation too soon afterwards will not take effect. Moving the rotation
after the test activity is launched gets rid of this flakiness.

The other source of flakiness is that rotating works but not until
after the test journal is separated, causing issues with the test
asserts. We solve this flakiness by waiting for the activity itself to
rotate to the expected orientation rather than just relying on the
window manager state to change.

Bug: 295876429
Bug: 294255156
Test: atest CtsWindowManagerDeviceOther:DockConfigChangeTests
      verified manually with --iterations
Change-Id: I48274783171a878c06caf272eda4f4789d1ea78a
1 file changed