Remove unnecessary perfetto/perfprofd messages from statsd_config proto

This change simplifies the on-device statsd_config.proto when
it comes to handling perfetto and perfprofd configs.
In both cases statsd doesn't need to deserialize or know the schema
of the nested perfetto/perfprofd configs, because it just passes
the binary-encoded message to the corresponding daemons.
This change replaces the submessage with a generic "bytes" field.

As per https://developers.google.com/protocol-buffers/docs/proto#updating
"Embedded messages are compatible with bytes if the bytes contain an
encoded version of the message."

Advantages:
* One less copy of perfetto/perfprofd config around, reducing the risk
  of getting that out of sync and the corresponding maintenance cost.
* Reduce the risk of failures within statsd if trying to parse an invalid
  or outdated config proto.
* Reduce the CPU usage of statsd, by avoiding deserialization and
  re-encoding of the config protos.
* Avoid bugs like b/111448265 where the binary size of statsd inflates
  if the config protos are too big.
* Reflect what happens in the statsd code, specifically the fact that
  statsd only sees the bytes of the config but doesn't touch/alter its
  contents.

This change depends on: aosp/718808 and ag/4569627

Bug: 111448265
Test: Manual + CTS (atest AnomalyDetectionTests#testPerfetto)
Change-Id: I6ede5fa07c3ab3f71d29d38f2a40a90e88a16fd6
6 files changed
tree: c8a0e2c156f8d5dec3bbca87f8048c0a0ecf3d1b
  1. bin/