summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishnu Nair <vishnun@google.com>2024-05-15 00:11:42 +0000
committerVishnu Nair <vishnun@google.com>2024-05-15 02:46:35 +0000
commit1e746788b4daef26f027d601efb560635dc3416d (patch)
treec8956b7a2d5ba6c5ab67a5cf5d30178172e3191b
parent27129116b251deb052db9eb38503f4172e70473c (diff)
downloadcts-1e746788b4daef26f027d601efb560635dc3416d.tar.gz
DO NOT MERGE: Ignore orientation requests if close to square display
Fix CTS test failures for devices with square displays requiring orientation changes from the test app. Test: atest android.view.surfacecontrol.cts.AttachedSurfaceControlTest#testOnBufferTransformHintChangedListener Fixes: 334762481 Change-Id: Ic3566f2d366c46350189f27f27ea61db8265d645
-rw-r--r--tests/surfacecontrol/src/android/view/surfacecontrol/cts/AttachedSurfaceControlTest.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/surfacecontrol/src/android/view/surfacecontrol/cts/AttachedSurfaceControlTest.java b/tests/surfacecontrol/src/android/view/surfacecontrol/cts/AttachedSurfaceControlTest.java
index 2d8374de215..4a63febd1c7 100644
--- a/tests/surfacecontrol/src/android/view/surfacecontrol/cts/AttachedSurfaceControlTest.java
+++ b/tests/surfacecontrol/src/android/view/surfacecontrol/cts/AttachedSurfaceControlTest.java
@@ -34,6 +34,7 @@ import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Insets;
import android.graphics.Rect;
+import android.server.wm.ActivityManagerTestBase;
import android.server.wm.IgnoreOrientationRequestSession;
import android.server.wm.WindowManagerStateHelper;
import android.util.Log;
@@ -135,13 +136,15 @@ public class AttachedSurfaceControlTest {
}
private void supportRotationCheck() {
- PackageManager pm =
- InstrumentationRegistry.getInstrumentation().getContext().getPackageManager();
+ Context context = InstrumentationRegistry.getInstrumentation().getContext();
+ PackageManager pm = context.getPackageManager();
boolean supportsRotation = pm.hasSystemFeature(PackageManager.FEATURE_SCREEN_PORTRAIT)
&& pm.hasSystemFeature(PackageManager.FEATURE_SCREEN_LANDSCAPE);
final boolean isFixedToUserRotation =
"enabled".equals(SystemUtil.runShellCommand(FIXED_TO_USER_ROTATION_COMMAND).trim());
Assume.assumeTrue(supportsRotation && !isFixedToUserRotation);
+ assumeFalse("Skipping test: square size may not have configuration changes",
+ ActivityManagerTestBase.isCloseToSquareDisplay(context));
}
@After