am d2b5fd8: AI 148374: CTS: Do not ask whether to resume a session when
Merge commit 'd2b5fd8abb19aa1a3aa1390a07d443fad25b2244' into donut
* commit 'd2b5fd8abb19aa1a3aa1390a07d443fad25b2244':
AI 148374: CTS: Do not ask whether to resume a session when started from command line
diff --git a/tools/host/src/com/android/cts/ConsoleUi.java b/tools/host/src/com/android/cts/ConsoleUi.java
index 3766e9a..27173a4 100644
--- a/tools/host/src/com/android/cts/ConsoleUi.java
+++ b/tools/host/src/com/android/cts/ConsoleUi.java
@@ -17,6 +17,7 @@
package com.android.cts;
import com.android.cts.TestHost.ActionType;
+import com.android.cts.TestHost.MODE;
import org.xml.sax.SAXException;
@@ -567,7 +568,9 @@
* else return CHOOSE_SESSION.
*/
private String chooseMode(ArrayList<TestSession> sessionList) throws IOException {
- if ((sessionList == null) || (sessionList.size() == 0)) {
+ if (TestHost.sMode == MODE.RUN || (sessionList == null) || (sessionList.size() == 0)) {
+ // do not prompt if the test run was started from command line mode, or when
+ // there are no existing sessions
return CREATE_SESSION;
}