Fix cts failure about automotive navigationBar
Due to automotive navigationBar is not transparent,
light navigationBar and navigationBar divider test case not needed.
Bug: 70311297
Test: run cts -m CtsSystemUiTestCases \
-t android.systemui.cts.LightBarTests#testLightNavigationBar
run cts -m CtsSystemUiTestCases \
-t android.systemui.cts.LightBarThemeTest#testNavigationBarDivider
Change-Id: I4c8188e301756d91dc1de60785dd8be8b787bd69
Merged-In: I4c8188e301756d91dc1de60785dd8be8b787bd69
Signed-off-by: Yue, VincentX <vincentx.yue@intel.com>
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java b/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
index 8b1e1b8..d3b48b8 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
@@ -110,8 +110,10 @@
PackageManager pm = getInstrumentation().getContext().getPackageManager();
if (pm.hasSystemFeature(PackageManager.FEATURE_WATCH)
|| pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
- || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
+ || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
+ || pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
// No navigation bar on TVs and watches.
+ // Car navigation is not transparent.
return;
}
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java b/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
index 8498578..1ce3c1b 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
@@ -24,6 +24,7 @@
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
+import android.content.pm.PackageManager;
import android.view.View;
import org.junit.Before;
@@ -60,6 +61,11 @@
@Test
public void testNavigationBarDivider() throws Exception {
+ PackageManager pm = getInstrumentation().getContext().getPackageManager();
+ if (pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
+ // Car navigation is not transparent
+ return;
+ }
if (!hasVirtualNavigationBar()) {
// No virtual navigation bar, so no effect.