From 7f1e7a1e65c7569ee400fd5be6cc1c36ce5a42c7 Mon Sep 17 00:00:00 2001 From: Kohsuke Yatoh Date: Thu, 21 Apr 2022 17:33:02 -0700 Subject: [PATCH] Do not run NotificationTest on Auto. Bug: 229820964 Test: atest InputMethodStressTest Change-Id: Icf218460fa842f59125c2c09b822b3444ffc1281 --- .../android/inputmethod/stresstest/NotificationTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java index 356c4705e6a77..4383303d4902f 100644 --- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java +++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java @@ -20,6 +20,8 @@ import static android.app.NotificationManager.IMPORTANCE_HIGH; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assume.assumeFalse; + import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -28,6 +30,7 @@ import android.app.RemoteInput; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.graphics.drawable.Icon; import android.platform.test.annotations.RootPermissionTest; import android.platform.test.rule.UnlockScreenRule; @@ -84,6 +87,9 @@ public final class NotificationTest { mContext = InstrumentationRegistry.getInstrumentation().getContext(); mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); mNotificationManager = mContext.getSystemService(NotificationManager.class); + PackageManager pm = mContext.getPackageManager(); + // Do not run on Automotive. + assumeFalse(pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)); } @After