Files
build/tools/aconfig/protos/aconfig.proto
Mårten Kongstad 1b8636bd7d aconfig: add proto bug field
Add a `bug` field on the flag_declaration and parsed_flag proto
messages. This field is optional in the sense that it can occur zero or
more times, and aconfig will simply pass any value through.

Bug fields are included in the aconfig dump format, which can be
processed by other tools.

Also unify how protos.rs checks that fields marked 'optional' in the
proto file, but in practice are 'required', are actually set.

Test: atest aconfig.test aconfig.test.java
Bug: 288261336
Change-Id: I93de0005674822c6ff4d699bdc2c6509763a7f7f
2023-06-22 16:50:33 +02:00

83 lines
2.1 KiB
Protocol Buffer

// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License
// This is the schema definition for aconfig files. Modifications need to be
// either backwards compatible, or include updates to all aconfig files in the
// Android tree.
syntax = "proto2";
package android.aconfig;
// messages used in both aconfig input and output
enum flag_state {
ENABLED = 1;
DISABLED = 2;
}
enum flag_permission {
READ_ONLY = 1;
READ_WRITE = 2;
}
// aconfig input messages: flag declarations and values
message flag_declaration {
optional string name = 1;
optional string namespace = 2;
optional string description = 3;
repeated string bug = 4;
};
message flag_declarations {
optional string package = 1;
repeated flag_declaration flag = 2;
};
message flag_value {
optional string package = 1;
optional string name = 2;
optional flag_state state = 3;
optional flag_permission permission = 4;
};
message flag_values {
repeated flag_value flag_value = 1;
};
// aconfig output messages: parsed and verified flag declarations and values
message tracepoint {
// path to declaration or value file relative to $TOP
optional string source = 1;
optional flag_state state = 2;
optional flag_permission permission = 3;
}
message parsed_flag {
optional string package = 1;
optional string name = 2;
optional string namespace = 3;
optional string description = 4;
repeated string bug = 5;
optional flag_state state = 6;
optional flag_permission permission = 7;
repeated tracepoint trace = 8;
}
message parsed_flags {
repeated parsed_flag parsed_flag = 1;
}