Attempt to reduce flakiness of AppConfigurationTests

Some test methods use RotationSession to set rotation and it will
be restored after the test is finished. But sometimes the restoration
may take longer time, and it causes the rotating state remains to
the next test.

Add a flag to wait for a stable state if needed. This also allows the
derived test classes to set it manually.

Bug: 196035655
Test: atest AppConfigurationTests# \
            testSplitscreenPortraitAppOrientationRequests, \
            testFullscreenAppOrientationRequests
Change-Id: I0514404b3ef2c4822196bd62a9e6a6a83619b799
1 file changed