perfetto: add code for building/enabling cts tests

Bug: 170524267
Change-Id: I9b910def246f1fa3884f22f40bfc205ad8de2276
diff --git a/Android.bp b/Android.bp
index 4f5c8de..16fefe9 100644
--- a/Android.bp
+++ b/Android.bp
@@ -3108,12 +3108,8 @@
 }
 
 // These targets are appended to the autogenerated Android.bp by tools/gen_android_bp.
-// TODO(lalitm): find a better way to do this sharing.
-
-// TODO(lalitm): uncomment these when the CTS tests are to be enabled.
-/*
-cc_test {
-  name: "CtsPerfettoTestCases",
+cc_library_static {
+  name: "perfetto_cts_deps",
   srcs: [
     "src/base/android_task_runner.cc",
     "src/base/test/test_task_runner.cc",
@@ -3126,59 +3122,33 @@
     "src/traced/probes/probes_producer.cc",
     "test/fake_consumer.cc",
     "test/end_to_end_integrationtest.cc",
-    "test/end_to_end_integrationtest_cts.cc",
   ],
-  static_libs: [
-    "libgmock",
-    "libgtest",
-    "libgtest_main",
-    "perfetto_src_tracing_ipc",
+  export_include_dirs: [
+    ".",
   ],
   shared_libs: [
-    "libandroid",
-    "liblog",
     "libprotobuf-cpp-lite",
   ],
-  test_suites: [
-    "cts",
-    "vts",
-    "general-tests",
-  ],
-  compile_multilib: "both",
-  multilib: {
-    lib32: {
-        suffix: "32",
-    },
-    lib64: {
-        suffix: "64",
-    },
-  },
-  cflags: [
-    "-DPERFETTO_BUILD_WITH_ANDROID",
+  static_libs: [
+    "perfetto_src_tracing_ipc",
+    "libgtest_prod",
   ],
 }
 
-cc_library_shared {
-  name: "libperfettocts_jni",
+cc_library_static {
+  name: "perfetto_cts_jni_deps",
   srcs: [
     "src/base/android_task_runner.cc",
     "src/base/test/test_task_runner.cc",
     "test/fake_producer.cc",
-    "test/cts/producer/jni/fake_producer_jni.cc",
-  ],
-  static_libs: [
-    "libprotobuf-cpp-lite",
-    "perfetto_src_tracing_ipc",
   ],
   shared_libs: [
-    "libandroid",
-    "liblog",
-    "libnativehelper_compat_libc++",
+    "libprotobuf-cpp-lite",
   ],
-  compile_multilib: "both",
-  stl: "libc++_static",
-  cflags: [
-    "-DPERFETTO_BUILD_WITH_ANDROID",
+  export_include_dirs: [
+    ".",
   ],
-}
-*/
\ No newline at end of file
+  static_libs: [
+    "perfetto_src_tracing_ipc",
+  ],
+}
\ No newline at end of file