Fixing build and continuing refactor
bug: 11561456
Change-Id: I30d63d6f761d31625c9ec18c200e9d73545db035
diff --git a/libs/commonutil/Android.mk b/libs/commonutil/Android.mk
index 7affc16..bf6985f 100644
--- a/libs/commonutil/Android.mk
+++ b/libs/commonutil/Android.mk
@@ -28,10 +28,7 @@
include $(CLEAR_VARS)
-# only TimeoutReq annotation used from the libs/util, so add it here
-LOCAL_SRC_FILES := \
- $(call all-java-files-under, src) \
- ../deviceutil/src/android/cts/util/TimeoutReq.java
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_MODULE_TAGS := optional
diff --git a/libs/deviceutil/src/android/cts/util/TimeoutReq.java b/libs/commonutil/src/com/android/cts/util/TimeoutReq.java
similarity index 100%
rename from libs/deviceutil/src/android/cts/util/TimeoutReq.java
rename to libs/commonutil/src/com/android/cts/util/TimeoutReq.java
diff --git a/libs/hostutil/Android.mk b/libs/hostutil/Android.mk
index e671c63..44a4a30 100644
--- a/libs/hostutil/Android.mk
+++ b/libs/hostutil/Android.mk
@@ -18,8 +18,10 @@
LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_JAVA_LIBRARIES := ctscommonutilhost
+
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := ctshostutil
-include $(BUILD_STATIC_JAVA_LIBRARY)
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsHostStore.java b/libs/hostutil/src/com/android/cts/util/CtsHostStore.java
similarity index 78%
rename from tools/tradefed-host/src/com/android/cts/tradefed/result/CtsHostStore.java
rename to libs/hostutil/src/com/android/cts/util/CtsHostStore.java
index 1aab91a..e943133 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsHostStore.java
+++ b/libs/hostutil/src/com/android/cts/util/CtsHostStore.java
@@ -13,10 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.cts.tradefed.result;
-
-import com.android.ddmlib.testrunner.TestIdentifier;
-import com.android.tradefed.device.ITestDevice;
+package com.android.cts.util;
import java.util.concurrent.ConcurrentHashMap;
@@ -47,16 +44,8 @@
* retrieves a CTS result for the given condition and remove it from the internal
* storage. If there is no result for the given condition, it will return null.
*/
- public static String removeCtsResult(String deviceSerial, TestIdentifier test) {
- return mMap.remove(generateTestKey(deviceSerial, test));
- }
-
- /**
- * return test key in the form of device_serial#class_name#method_name
- */
- private static String generateTestKey(String deviceSerial, TestIdentifier test) {
- return String.format("%s#%s", deviceSerial, test.toString());
-
+ public static String removeCtsResult(String deviceSerial, String classMethodName) {
+ return mMap.remove(generateTestKey(deviceSerial, classMethodName));
}
/**
diff --git a/libs/hostutil/src/com/android/cts/util/HostReportLog.java b/libs/hostutil/src/com/android/cts/util/HostReportLog.java
index 32cd715..72bcc4c 100644
--- a/libs/hostutil/src/com/android/cts/util/HostReportLog.java
+++ b/libs/hostutil/src/com/android/cts/util/HostReportLog.java
@@ -16,9 +16,6 @@
package com.android.cts.util;
-import com.android.cts.tradefed.result.CtsHostStore;
-
-
/**
* ReportLog for host tests
* Note that setTestInfo should be set before throwing report
diff --git a/suite/cts/hostTests/jank/Android.mk b/suite/cts/hostTests/jank/Android.mk
index 96ab124..5d83009 100644
--- a/suite/cts/hostTests/jank/Android.mk
+++ b/suite/cts/hostTests/jank/Android.mk
@@ -22,9 +22,7 @@
LOCAL_MODULE := CtsHostJank
-LOCAL_STATIC_JAVA_LIBRARIES := ctscommonutilhost
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt ctscommonutilhost
LOCAL_CTS_TEST_PACKAGE := com.android.cts.jank
diff --git a/suite/cts/hostTests/uihost/Android.mk b/suite/cts/hostTests/uihost/Android.mk
index b74d87b..85a7a92 100644
--- a/suite/cts/hostTests/uihost/Android.mk
+++ b/suite/cts/hostTests/uihost/Android.mk
@@ -22,9 +22,7 @@
LOCAL_MODULE := CtsHostUi
-LOCAL_STATIC_JAVA_LIBRARIES := ctscommonutilhost
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt ddmlib-prebuilt junit ctshostutil ctscommonutilhost
LOCAL_CTS_TEST_PACKAGE := com.android.cts.uihost
diff --git a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
index 8c483eb..323d9a9 100644
--- a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
+++ b/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
@@ -19,14 +19,14 @@
import android.cts.util.TimeoutReq;
import com.android.cts.tradefed.build.CtsBuildHelper;
-import com.android.cts.tradefed.result.CtsHostStore;
import com.android.cts.tradefed.result.CtsReportUtil;
+import com.android.cts.util.CtsHostStore;
+import com.android.cts.util.HostReportLog;
+import com.android.cts.util.ReportLog;
import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
import com.android.ddmlib.testrunner.TestIdentifier;
-import com.android.cts.util.HostReportLog;
-import com.android.cts.util.ReportLog;
import com.android.tradefed.build.IBuildInfo;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
diff --git a/tools/tradefed-host/Android.mk b/tools/tradefed-host/Android.mk
index 8637905..aea81ca 100644
--- a/tools/tradefed-host/Android.mk
+++ b/tools/tradefed-host/Android.mk
@@ -16,18 +16,14 @@
include $(CLEAR_VARS)
-# libs/hostutil is treated specially
-# as it cannot be put into commonutilhost due to dependency on cts-tradefed
-LOCAL_SRC_FILES := \
- $(call all-java-files-under, src) \
- $(call all-java-files-under, ../../libs/hostutil/src)
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_JAVA_RESOURCE_DIRS := res
LOCAL_MODULE := cts-tradefed
LOCAL_MODULE_TAGS := optional
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt hosttestlib
-LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceinfolib ctscommonutilhost
+LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed-prebuilt hosttestlib ctshostutil ctscommonutilhost
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceinfolib
include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java
index 26bc81c..58b746d 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/result/CtsXmlResultReporter.java
@@ -19,6 +19,7 @@
import com.android.cts.tradefed.build.CtsBuildHelper;
import com.android.cts.tradefed.device.DeviceInfoCollector;
import com.android.cts.tradefed.testtype.CtsTest;
+import com.android.cts.util.CtsHostStore;
import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmlib.testrunner.TestIdentifier;
@@ -281,7 +282,7 @@
String perfResult = CtsReportUtil.getCtsResultFromMetrics(testMetrics);
// host test should be checked in CtsHostStore.
if (perfResult == null) {
- perfResult = CtsHostStore.removeCtsResult(mDeviceSerial, test);
+ perfResult = CtsHostStore.removeCtsResult(mDeviceSerial, test.toString());
}
if (perfResult != null) {
// CTS result is passed in Summary++++Details format.