aconfig: define Aconfig proto

Fill in aconfig.proto. Define Aconfig definitions (for introducing flags
and setting their values) and Overrides (for overriding flags regardless
of what their definitions say). More changes to the proto schema are
expected when more of the aconfig project is outlined.

Use proto2 instead of proto3: this will cause the protobuf text parser
to error on missing fields instead of returning a default value which is
ambiguous, especially for booleans. (Also, the text protobuf parser
doesn't provide good error messages: if the input is missing a field,
the error is always "1:1: Message not initialized").

Unfortunately the generated Rust wrappers around the proto structs land
in an external crate, which prevents aconfig from adding new impl
blocks. Circumvent this by converting the data read from proto into
structs defined in the aconfig crate.

Change main.rs to parse (static) text proto.

Also add dependency on anyhow.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I512e3b61ef20e2f55b7699a178d466d2a9a89eac
diff --git a/tools/aconfig/protos/aconfig.proto b/tools/aconfig/protos/aconfig.proto
index 989c398..7d0e8ad 100644
--- a/tools/aconfig/protos/aconfig.proto
+++ b/tools/aconfig/protos/aconfig.proto
@@ -12,12 +12,29 @@
 // See the License for the specific language governing permissions and
 // limitations under the License
 
-// Placeholder proto file. Will be replaced by actual contents.
+// This is the schema definition for of Aconfig files. Modifications need to be
+// either backwards compatible, or include updates to all Aconfig files in the
+// Android tree.
 
-syntax = "proto3";
+syntax = "proto2";
 
 package android.aconfig;
 
-message Placeholder {
-  string name = 1;
-}
+message flag {
+  required string id = 1;
+  required string description = 2;
+  required bool value = 3;
+};
+
+message android_config {
+  repeated flag flag = 1;
+};
+
+message override {
+  required string id = 1;
+  required bool value = 2;
+};
+
+message override_config {
+  repeated override override = 1;
+};