Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d874f189 authored by Guang Zhu's avatar Guang Zhu Committed by The Android Automerger
Browse files

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
parent b25bc454
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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();
    }