Distinguish between landscape and seascape

Symptom:
android:screenOrientation="landscape" does not work. The activity is
shown in seascape mode when the screen orientation is locked in seascape
mode.

Root cause:
DisplayRotation allows showing an activity in seascape mode even
though the activity has SCREEN_ORIENTATION_LANDSCAPE flag. Some
application wants to avoid seascape mode but it can not.

Solution:
Respect android:screenOrientation="landscape" attribute. The screen
should be flipped from seascape to landscape according to the attribute.
Also respect "portrait" in the same way.

Bug: 132665278
Test: atest DisplayRotationTest
Change-Id: Ia5b1115797df78838c8693206f5ed1f0af62c49c
2 files changed