Merge "Tag libstatspull and libstatssocket tests as MTS" into rvc-dev
diff --git a/libstats/pull/Android.bp b/libstats/pull/Android.bp
index ef1c5c5..c9f13a3 100644
--- a/libstats/pull/Android.bp
+++ b/libstats/pull/Android.bp
@@ -84,7 +84,15 @@
         "libstatspull",
         "libstatssocket",
     ],
-    test_suites: ["general-tests"],
+    test_suites: ["general-tests", "mts"],
+    //TODO(b/153588990): Remove when the build system properly separates 
+    //32bit and 64bit architectures.
+    compile_multilib: "both",
+    multilib: {
+        lib64: {
+            suffix: "64",
+        }
+    },
     cflags: [
         "-Wall",
         "-Werror",
diff --git a/libstats/socket/Android.bp b/libstats/socket/Android.bp
index 8c12fe0..3f42088 100644
--- a/libstats/socket/Android.bp
+++ b/libstats/socket/Android.bp
@@ -122,5 +122,13 @@
         "libcutils",
         "libutils",
     ],
-    test_suites: ["device-tests"],
+    test_suites: ["device-tests", "mts"],
+    //TODO(b/153588990): Remove when the build system properly separates 
+    //32bit and 64bit architectures.
+    compile_multilib: "both",
+    multilib: {
+        lib64: {
+            suffix: "64",
+        }
+    },
 }
diff --git a/libstats/socket/tests/stats_event_test.cpp b/libstats/socket/tests/stats_event_test.cpp
index 6e47e3d..80ef145 100644
--- a/libstats/socket/tests/stats_event_test.cpp
+++ b/libstats/socket/tests/stats_event_test.cpp
@@ -53,7 +53,12 @@
 // Side-effect: this function moves the start of the buffer past the read value
 template <class T>
 T readNext(uint8_t** buffer) {
-    T value = *(T*)(*buffer);
+    T value;
+    if ((reinterpret_cast<uintptr_t>(*buffer) % alignof(T)) == 0) {
+        value = *(T*)(*buffer);
+    } else {
+        memcpy(&value, *buffer, sizeof(T));
+    }
     *buffer += sizeof(T);
     return value;
 }