Fix CTS for UiAutomator device orientation in tests

bug: 8399636
Change-Id: I4c07a929ffef3b4d9a49ffcdcd083bc56b143c43
diff --git a/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java b/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
index 5de9805..5885315 100644
--- a/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
+++ b/tests/uiautomator/src/com/android/cts/uiautomatortest/CtsUiAutomatorTest.java
@@ -787,6 +787,12 @@
      * @throws UiObjectNotFoundException
      */
     private void openTest(String name) throws UiObjectNotFoundException {
+        try {
+            UiDevice.getInstance().setOrientationNatural();
+        } catch (RemoteException e) {
+            // will catch it in its own test. For now try to put the device
+            // in its natural orientation prior to each test
+        }
         UiScrollable listView = new UiScrollable(
                 new UiSelector().className(android.widget.ListView.class.getName()));