Merge "Ensure we log the mode during reboot"
diff --git a/src/com/android/tradefed/invoker/shard/token/TelephonyTokenProvider.java b/src/com/android/tradefed/invoker/shard/token/TelephonyTokenProvider.java
index 2b62177..0a50a70 100644
--- a/src/com/android/tradefed/invoker/shard/token/TelephonyTokenProvider.java
+++ b/src/com/android/tradefed/invoker/shard/token/TelephonyTokenProvider.java
@@ -62,12 +62,17 @@
case SECURE_ELEMENT_SIM_CARD:
if (info.mHasSecuredElement && info.mHasSeService) {
// TODO: Improve how we detect this use case.
- if (ORANGE_SIM_ID.equals(device.getProperty(GSM_OPERATOR_PROP))) {
+ String simProp = device.getProperty(GSM_OPERATOR_PROP);
+ if (ORANGE_SIM_ID.equals(simProp)) {
return true;
} else {
CLog.w(
- "%s doesn't have a Orange Sim card for secured elements.",
- device.getSerialNumber());
+ "%s doesn't have a Orange Sim card (%s) for secured elements."
+ + " %s returned: '%s'",
+ device.getSerialNumber(),
+ ORANGE_SIM_ID,
+ GSM_OPERATOR_PROP,
+ simProp);
}
}
diff --git a/src/com/android/tradefed/testtype/suite/SuiteModuleLoader.java b/src/com/android/tradefed/testtype/suite/SuiteModuleLoader.java
index af056ea..df958aa 100644
--- a/src/com/android/tradefed/testtype/suite/SuiteModuleLoader.java
+++ b/src/com/android/tradefed/testtype/suite/SuiteModuleLoader.java
@@ -559,6 +559,7 @@
private List<IModuleParameter> getModuleParameters(String moduleName, IConfiguration config)
throws ConfigurationException {
List<IModuleParameter> params = new ArrayList<>();
+ Set<String> processedParameterArgs = new HashSet<>();
// Track family of the parameters to make sure we have no duplicate.
Map<String, ModuleParameters> duplicateModule = new LinkedHashMap<>();
@@ -568,6 +569,10 @@
return params;
}
for (String p : parameters) {
+ if (!processedParameterArgs.add(p)) {
+ // Avoid processing the same parameter twice
+ continue;
+ }
ModuleParameters suiteParam = ModuleParameters.valueOf(p.toUpperCase());
String family = suiteParam.getFamily();
if (duplicateModule.containsKey(family)) {
diff --git a/tests/src/com/android/tradefed/testtype/suite/SuiteModuleLoaderTest.java b/tests/src/com/android/tradefed/testtype/suite/SuiteModuleLoaderTest.java
index eae0c50..3df2d4b 100644
--- a/tests/src/com/android/tradefed/testtype/suite/SuiteModuleLoaderTest.java
+++ b/tests/src/com/android/tradefed/testtype/suite/SuiteModuleLoaderTest.java
@@ -64,6 +64,8 @@
private static final String TEST_INSTANT_CONFIG =
"<configuration description=\"Runs a stub tests part of some suite\">\n"
+ " <option name=\"config-descriptor:metadata\" key=\"parameter\" value=\"instant_app\" />"
+ // Duplicate parameter should not have impact
+ + " <option name=\"config-descriptor:metadata\" key=\"parameter\" value=\"instant_app\" />"
+ " <test class=\"com.android.tradefed.testtype.suite.TestSuiteStub\" />\n"
+ "</configuration>";