am bfa07537: Merge "Fix CTS for UiAutomator device orientation in tests" into jb-mr1.1-dev
* commit 'bfa0753732c8749d694df3e6b8f0c460c1259796':
Fix CTS for UiAutomator device orientation in tests
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()));