Update CtsThemeHostTestCases to recognize x86_64 emulator
Bug: 140343500
Test: ThemeHostTest
Change-Id: Ic7fd0e3c3dbc21e96f323c55259838d1d0157785
diff --git a/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java b/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java
index f31b081..2fcbb5b 100644
--- a/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java
+++ b/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java
@@ -295,7 +295,7 @@
private static int getDensityForDevice(ITestDevice device) throws DeviceNotAvailableException {
final String densityProp;
- if (device.getSerialNumber().startsWith("emulator-")) {
+ if (isEmulator(device)) {
densityProp = DENSITY_PROP_EMULATOR;
} else {
densityProp = DENSITY_PROP_DEVICE;
@@ -308,4 +308,9 @@
|| hardwareTypeString.contains("android.hardware.type.television")
|| hardwareTypeString.contains("android.hardware.type.automotive");
}
+
+ private static boolean isEmulator(ITestDevice device) {
+ // Expecting something like "emulator-XXXX" or "EMULATORXXXX".
+ return device.getSerialNumber().toLowerCase().startsWith("emulator");
+ }
}