Fixes rotating tablet changing original dock side in landscape

Tablets can dock to the right side in landscape/seascape and when
rotating between portrait to either landscape or seascape it would
produce the primary split to be on the left for landscape and right for
seascape. Also rotating from landscape to portrait and back would change
the original dock side to the otherside if docked from the right. This
is fixed by keeping track of the original dock side and checking to see
if the new side is valid respect to the original dock side.

Change-Id: Ia430518d901f4c009e05e637a636b8262cff18fa
Fixes: 68218244
Test: runtest --path cts/tests/framework/base/activitymanager/src/
android/server/am/ActivityManagerDockedStackTests.java
2 files changed