blob: 1a80b0420d92af93722da9fe55e86aad188a57eb [file] [log] [blame]
Mårten Kongstad867a3492023-04-25 15:06:30 +02001// Copyright (C) 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License
14
Mårten Kongstadfa23d292023-05-11 14:47:02 +020015// This is the schema definition for aconfig files. Modifications need to be
16// either backwards compatible, or include updates to all aconfig files in the
Mårten Kongstadbb520722023-04-26 13:16:41 +020017// Android tree.
Mårten Kongstad867a3492023-04-25 15:06:30 +020018
Mårten Kongstadbb520722023-04-26 13:16:41 +020019syntax = "proto2";
Mårten Kongstad867a3492023-04-25 15:06:30 +020020
21package android.aconfig;
22
Mårten Kongstad30950782023-05-09 13:31:29 +020023// messages used in both aconfig input and output
24
Mårten Kongstadc68c4ea2023-05-05 16:20:09 +020025enum flag_state {
26 ENABLED = 1;
27 DISABLED = 2;
28}
29
Mårten Kongstad30950782023-05-09 13:31:29 +020030enum flag_permission {
Mårten Kongstad416330b2023-05-05 11:10:01 +020031 READ_ONLY = 1;
32 READ_WRITE = 2;
33}
34
Mårten Kongstadfa23d292023-05-11 14:47:02 +020035// aconfig input messages: flag declarations and values
Mårten Kongstad30950782023-05-09 13:31:29 +020036
Mårten Kongstadfa23d292023-05-11 14:47:02 +020037message flag_declaration {
Mårten Kongstada2e5ab82023-06-19 16:28:54 +020038 optional string name = 1;
39 optional string namespace = 2;
40 optional string description = 3;
Mårten Kongstad1b8636b2023-06-22 10:12:24 +020041 repeated string bug = 4;
Zhi Dou71f1b352023-08-21 22:49:46 +000042 optional bool is_fixed_read_only = 5;
Oriol Prieto Gasco0b9d2892023-11-20 16:23:51 +000043 optional bool is_exported = 6;
Mårten Kongstadbb520722023-04-26 13:16:41 +020044};
45
Mårten Kongstadfa23d292023-05-11 14:47:02 +020046message flag_declarations {
Mårten Kongstada2e5ab82023-06-19 16:28:54 +020047 optional string package = 1;
Mårten Kongstadfa23d292023-05-11 14:47:02 +020048 repeated flag_declaration flag = 2;
Oriol Prieto Gasco7afc7e72023-11-22 13:26:02 +000049 optional string container = 3;
Mårten Kongstadbb520722023-04-26 13:16:41 +020050};
51
Mårten Kongstadfa23d292023-05-11 14:47:02 +020052message flag_value {
Mårten Kongstada2e5ab82023-06-19 16:28:54 +020053 optional string package = 1;
54 optional string name = 2;
55 optional flag_state state = 3;
56 optional flag_permission permission = 4;
Mårten Kongstadbb520722023-04-26 13:16:41 +020057};
58
Mårten Kongstadfa23d292023-05-11 14:47:02 +020059message flag_values {
60 repeated flag_value flag_value = 1;
Mårten Kongstadbb520722023-04-26 13:16:41 +020061};
Mårten Kongstada1029092023-05-08 11:51:59 +020062
Mårten Kongstadfa23d292023-05-11 14:47:02 +020063// aconfig output messages: parsed and verified flag declarations and values
Mårten Kongstada1029092023-05-08 11:51:59 +020064
Mårten Kongstad30950782023-05-09 13:31:29 +020065message tracepoint {
Mårten Kongstadfa23d292023-05-11 14:47:02 +020066 // path to declaration or value file relative to $TOP
Mårten Kongstada2e5ab82023-06-19 16:28:54 +020067 optional string source = 1;
68 optional flag_state state = 2;
69 optional flag_permission permission = 3;
Mårten Kongstada1029092023-05-08 11:51:59 +020070}
71
Mårten Kongstad30950782023-05-09 13:31:29 +020072message parsed_flag {
Mårten Kongstada2e5ab82023-06-19 16:28:54 +020073 optional string package = 1;
74 optional string name = 2;
75 optional string namespace = 3;
76 optional string description = 4;
Mårten Kongstad1b8636b2023-06-22 10:12:24 +020077 repeated string bug = 5;
78 optional flag_state state = 6;
79 optional flag_permission permission = 7;
80 repeated tracepoint trace = 8;
Zhi Dou71f1b352023-08-21 22:49:46 +000081 optional bool is_fixed_read_only = 9;
Oriol Prieto Gasco0b9d2892023-11-20 16:23:51 +000082 optional bool is_exported = 10;
Oriol Prieto Gasco7afc7e72023-11-22 13:26:02 +000083 optional string container = 11;
Mårten Kongstad30950782023-05-09 13:31:29 +020084}
85
86message parsed_flags {
87 repeated parsed_flag parsed_flag = 1;
Mårten Kongstada1029092023-05-08 11:51:59 +020088}