Merge "Compile NetworkStackApiStable as system_29"
diff --git a/tests/lib/Android.bp b/tests/lib/Android.bp
index 1db4054..249088f 100644
--- a/tests/lib/Android.bp
+++ b/tests/lib/Android.bp
@@ -15,6 +15,19 @@
 //
 
 java_library {
+    name: "net-tests-utils-multivariant",
+    srcs: [
+        "multivariant/**/*.java",
+        "multivariant/**/*.kt",
+    ],
+    host_supported: true,
+    static_libs: [
+        "kotlin-test",
+        "junit",
+    ],
+}
+
+java_library {
     name: "net-tests-utils",
     srcs: [
         "src/**/*.java",
@@ -22,8 +35,7 @@
     ],
     defaults: ["lib_mockito_extended"],
     static_libs: [
-        "kotlin-test",
-        "junit",
+        "net-tests-utils-multivariant",
     ],
 }
 
diff --git a/tests/lib/src/com/android/testutils/ConcurrentUtils.kt b/tests/lib/multivariant/com/android/testutils/ConcurrentUtils.kt
similarity index 100%
rename from tests/lib/src/com/android/testutils/ConcurrentUtils.kt
rename to tests/lib/multivariant/com/android/testutils/ConcurrentUtils.kt
diff --git a/tests/lib/src/com/android/testutils/ExceptionUtils.java b/tests/lib/multivariant/com/android/testutils/ExceptionUtils.java
similarity index 100%
rename from tests/lib/src/com/android/testutils/ExceptionUtils.java
rename to tests/lib/multivariant/com/android/testutils/ExceptionUtils.java
diff --git a/tests/lib/multivariant/com/android/testutils/FileUtils.kt b/tests/lib/multivariant/com/android/testutils/FileUtils.kt
new file mode 100644
index 0000000..678f977
--- /dev/null
+++ b/tests/lib/multivariant/com/android/testutils/FileUtils.kt
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package com.android.testutils
+
+// This function is private because the 2 is hardcoded here, and is not correct if not called
+// directly from __LINE__ or __FILE__.
+private fun callerStackTrace(): StackTraceElement = try {
+    throw RuntimeException()
+} catch (e: RuntimeException) {
+    e.stackTrace[2] // 0 is here, 1 is get() in __FILE__ or __LINE__
+}
+val __FILE__: String get() = callerStackTrace().fileName
+val __LINE__: Int get() = callerStackTrace().lineNumber
diff --git a/tests/lib/src/com/android/testutils/MiscAsserts.kt b/tests/lib/multivariant/com/android/testutils/MiscAsserts.kt
similarity index 98%
rename from tests/lib/src/com/android/testutils/MiscAsserts.kt
rename to tests/lib/multivariant/com/android/testutils/MiscAsserts.kt
index 5019dcd..17540a8 100644
--- a/tests/lib/src/com/android/testutils/MiscAsserts.kt
+++ b/tests/lib/multivariant/com/android/testutils/MiscAsserts.kt
@@ -16,7 +16,6 @@
 
 package com.android.testutils
 
-import android.util.Log
 import com.android.testutils.ExceptionUtils.ThrowingRunnable
 import java.lang.reflect.Modifier
 import kotlin.system.measureTimeMillis
@@ -80,7 +79,6 @@
 fun assertRunsInAtMost(descr: String, timeLimit: Long, fn: () -> Unit) {
     val timeTaken = measureTimeMillis(fn)
     val msg = String.format("%s: took %dms, limit was %dms", descr, timeTaken, timeLimit)
-    Log.d(TAG, msg)
     assertTrue(timeTaken <= timeLimit, msg)
 }
 
diff --git a/tests/lib/src/com/android/testutils/TrackRecord.kt b/tests/lib/multivariant/com/android/testutils/TrackRecord.kt
similarity index 100%
rename from tests/lib/src/com/android/testutils/TrackRecord.kt
rename to tests/lib/multivariant/com/android/testutils/TrackRecord.kt
diff --git a/tests/lib/src/com/android/testutils/FileUtils.kt b/tests/lib/src/com/android/testutils/FileUtils.kt
deleted file mode 100644
index edd8d83..0000000
--- a/tests/lib/src/com/android/testutils/FileUtils.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.android.testutils
-
-// This function is private because the 2 is hardcoded here, and is not correct if not called
-// directly from __LINE__ or __FILE__.
-private fun callerStackTrace(): StackTraceElement = try {
-    throw RuntimeException()
-} catch (e: RuntimeException) {
-    e.stackTrace[2] // 0 is here, 1 is get() in __FILE__ or __LINE__
-}
-val __FILE__: String get() = callerStackTrace().fileName
-val __LINE__: Int get() = callerStackTrace().lineNumber