From 6ac0c8c5faaa2fdf56a533a6a3452d53850809ee Mon Sep 17 00:00:00 2001 From: Guang Zhu Date: Thu, 28 May 2015 13:22:28 -0700 Subject: lock device orientation during app compatibility test Devices on test benches are usually held sideways, which leads to app rotation during launch. While it's useful to identify such issue from an app perspective, the app compatibility test should be isolated from such noise for the purpose of the testing for basic level of compatibility. Change-Id: I403f96e5d8512ca6a17b05a83d69f4b02f760a32 --- .../src/com/android/compatibilitytest/AppCompatibility.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/Compatibility/src') diff --git a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java index eaff6c74ad30..f81b001cdd18 100644 --- a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java +++ b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java @@ -17,6 +17,7 @@ package com.android.compatibilitytest; import android.app.ActivityManager; +import android.app.UiAutomation; import android.app.UiModeManager; import android.app.ActivityManager.ProcessErrorStateInfo; import android.app.ActivityManager.RunningTaskInfo; @@ -82,10 +83,12 @@ public class AppCompatibility extends InstrumentationTestCase { if (workspaceLaunchTimeoutMsecs != null) { mWorkspaceLaunchTimeout = Integer.parseInt(workspaceLaunchTimeoutMsecs); } + getInstrumentation().getUiAutomation().setRotation(UiAutomation.ROTATION_FREEZE_0); } @Override protected void tearDown() throws Exception { + getInstrumentation().getUiAutomation().setRotation(UiAutomation.ROTATION_UNFREEZE); super.tearDown(); } -- cgit v1.2.3-59-g8ed1b