Convert statsd_test and statsd_benchmark to proto lite

libplatformprotos for the device is compiled using proto lite, and
statsd_test and statsd_benchmark have protos that reference the
libplatformprotos.  With protobuf 3.9.1 compiling a full proto
against a lite proto doesn't work.  Convert them to lite.  Requires
adding the protobuf internal protos to the sources,
libprotobuf-cpp-lite does not contain the compiled version of
field_options.proto.

Bug: 117607748
Test: m checkbuild
Exempt-From-Owner-Approval: approved at https://android-review.googlesource.com/q/I0b101555ff604df17b2e3e06f3b3ce25adb1c9fb
Change-Id: I0b101555ff604df17b2e3e06f3b3ce25adb1c9fb
diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp
index 19fa640..7244e74 100644
--- a/cmds/statsd/Android.bp
+++ b/cmds/statsd/Android.bp
@@ -204,6 +204,10 @@
     ],
 
     srcs: [
+        // atom_field_options.proto needs field_options.proto, but that is
+        // not included in libprotobuf-cpp-lite, so compile it here.
+        ":libprotobuf-internal-protos",
+
         "src/atom_field_options.proto",
         "src/atoms.proto",
         "src/stats_log.proto",
@@ -262,11 +266,11 @@
     ],
 
     proto: {
-        type: "full",
+        type: "lite",
         include_dirs: ["external/protobuf/src"],
     },
 
-    shared_libs: ["libprotobuf-cpp-full"],
+    shared_libs: ["libprotobuf-cpp-lite"],
 
 }
 
@@ -279,6 +283,10 @@
     defaults: ["statsd_defaults"],
 
     srcs: [
+        // atom_field_options.proto needs field_options.proto, but that is
+        // not included in libprotobuf-cpp-lite, so compile it here.
+        ":libprotobuf-internal-protos",
+
         "src/atom_field_options.proto",
         "src/atoms.proto",
         "src/stats_log.proto",
@@ -293,7 +301,7 @@
     ],
 
     proto: {
-        type: "full",
+        type: "lite",
         include_dirs: ["external/protobuf/src"],
     },
 
@@ -315,7 +323,7 @@
     shared_libs: [
         "libgtest_prod",
         "libstatslog",
-        "libprotobuf-cpp-full",
+        "libprotobuf-cpp-lite",
     ],
 }