Add mts-precondition.xml to verify device conditions before running mts
tests.

Test: m mts, mts-tradefed run mts
Bug: 123411735
Change-Id: I4026169a6a774512b95d0a43dc5bbad900424953
diff --git a/tools/mts-tradefed/res/config/mts-preconditions.xml b/tools/mts-tradefed/res/config/mts-preconditions.xml
new file mode 100644
index 0000000..7a2329c
--- /dev/null
+++ b/tools/mts-tradefed/res/config/mts-preconditions.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="MTS precondition configs">
+
+    <option name="plan" value="mts-preconditions" />
+
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.StayAwakePreparer" />
+
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.SettingsPreparer">
+        <option name="device-setting" value="verifier_verify_adb_installs"/>
+        <option name="setting-type" value="global"/>
+        <option name="set-value" value="0"/>
+    </target_preparer>
+
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.WifiCheck" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+        <option name="run-command" value="rm -rf /sdcard/device-info-files" />
+        <option name="run-command" value="rm -rf /sdcard/report-log-files" />
+    </target_preparer>
+
+</configuration>
diff --git a/tools/mts-tradefed/res/config/mts.xml b/tools/mts-tradefed/res/config/mts.xml
index ad6e8fe..06d6cb3 100644
--- a/tools/mts-tradefed/res/config/mts.xml
+++ b/tools/mts-tradefed/res/config/mts.xml
@@ -19,6 +19,8 @@
     <option name="plan" value="mts" />
     <option name="test-tag" value="mts" />
 
+    <include name="mts-preconditions" />
+
     <option name="enable-root" value="false" />
 
     <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">