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
This commit is contained in:
Guang Zhu
2015-05-28 13:22:28 -07:00
parent 3aeb5f848e
commit 6ac0c8c5fa

View File

@@ -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();
}