1//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17// ==========================================================
18// Build the library for use on the host
19// ==========================================================
20package {
21    default_applicable_licenses: ["Android-Apache-2.0"],
22}
23
24// Enum protos can be reused in multiple libraries (pixelatoms.proto, etc)
25// Due to size grownth constraints proposed to reuse only what really imported
26shared_enum_protos = [
27    "enums/app/**/*.proto",
28    "enums/display/*.proto",
29]
30
31enum_protos = [
32    "enums/adservices/common/*.proto",
33    "enums/adservices/enrollment/*.proto",
34    "enums/adservices/fledge/*.proto",
35    "enums/adservices/measurement/*.proto",
36    "enums/anr/*.proto",
37    "enums/apex/*.proto",
38    "enums/appsearch/*.proto",
39    "enums/autofill/**/*.proto",
40    "enums/contexthub/*.proto",
41    "enums/corenetworking/**/*.proto",
42    "enums/debug/*.proto",
43    "enums/devicepolicy/*.proto",
44    "enums/dnd/*.proto",
45    "enums/federatedcompute/*.proto",
46    "enums/hardware/**/*.proto",
47    "enums/healthfitness/**/*.proto",
48    "enums/hotword/*.proto",
49    "enums/input/*.proto",
50    "enums/jank/*.proto",
51    "enums/media/**/*.proto",
52    "enums/mms/*.proto",
53    "enums/nearby/*.proto",
54    "enums/net/*.proto",
55    "enums/neuralnetworks/*.proto",
56    "enums/nfc/*.proto",
57    "enums/os/*.proto",
58    "enums/photopicker/*.proto",
59    "enums/pdf/*.proto",
60    "enums/server/*.proto",
61    "enums/server/display/*.proto",
62    "enums/server/job/*.proto",
63    "enums/server/location/*.proto",
64    "enums/service/*.proto",
65    "enums/stats/*.proto",
66    "enums/stats/accessibility/*.proto",
67    "enums/stats/docsui/*.proto",
68    "enums/stats/hdmi/*.proto",
69    "enums/stats/ike/*.proto",
70    "enums/stats/intelligence/*.proto",
71    "enums/stats/location/*.proto",
72    "enums/stats/mediametrics/*.proto",
73    "enums/stats/mediaprovider/*.proto",
74    "enums/stats/mobiledatadownload/*.proto",
75    "enums/stats/otaupdate/*.proto",
76    "enums/stats/privacysignals/*.proto",
77    "enums/stats/safetycenter/*.proto",
78    "enums/stats/storage/*.proto",
79    "enums/stats/sysui/*.proto",
80    "enums/stats/tls/*.proto",
81    "enums/stats/tv/*.proto",
82    "enums/stats/wm/*.proto",
83    "enums/system/**/*.proto",
84    "enums/telecomm/*.proto",
85    "enums/telephony/*.proto",
86    "enums/telephony/qns/*.proto",
87    "enums/telephony/satellite/*.proto",
88    "enums/telephony/security/*.proto",
89    "enums/transparency/*.proto",
90    "enums/uwb/*.proto",
91    "enums/view/**/*.proto",
92    "enums/wear/connectivity/*.proto",
93    "enums/wear/media/*.proto",
94    "enums/wear/modes/*.proto",
95    "enums/wifi/*.proto",
96    ":data_stall_event_proto",
97    ":device_policy_proto",
98    ":dns_resolver_proto",
99    ":launcher_proto",
100    ":network_stack_proto",
101    ":connectivity_service_proto",
102    ":srcs_bluetooth_protos",
103    ":srcs_bluetooth_leaudio_protos",
104    ":style_proto",
105    ":tethering_proto",
106    ":text_classifier_proto",
107]
108
109atom_protos = [
110    "atoms.proto",
111    "attribution_node.proto",
112    "atoms/adpf/*.proto",
113    "atoms/agif/*.proto",
114    "atoms/apex/*.proto",
115    "atoms/aiwallpapers/*.proto",
116    "atoms/art/*.proto",
117    "atoms/appsearch/*.proto",
118    "atoms/bluetooth/*.proto",
119    "atoms/corenetworking/**/*.proto",
120    "atoms/autofill/*.proto",
121    "atoms/credentials/*.proto",
122    "atoms/cronet/*.proto",
123    "atoms/devicepolicy/*.proto",
124    "atoms/display/*.proto",
125    "atoms/dnd/*.proto",
126    "atoms/dream/*.proto",
127    "atoms/expresslog/*.proto",
128    "atoms/framework/*.proto",
129    "atoms/gps/*.proto",
130    "atoms/grammaticalinflection/*.proto",
131    "atoms/hardware/biometrics/*.proto",
132    "atoms/hdmi/*.proto",
133    "atoms/healthfitness/**/*.proto",
134    "atoms/hotword/*.proto",
135    "atoms/ike/*.proto",
136    "atoms/input/*.proto",
137    "atoms/locale/*.proto",
138    "atoms/wearsysui/*.proto",
139    "atoms/location/*.proto",
140    "atoms/view/inputmethod/*.proto",
141    "atoms/nfc/*.proto",
142    "atoms/packagemanager/*.proto",
143    "atoms/pdf/*.proto",
144    "atoms/permissioncontroller/*.proto",
145    "atoms/placeholder/*.proto",
146    "atoms/power/*.proto",
147    "atoms/rkpd/*.proto",
148    "atoms/settings/*.proto",
149    "atoms/sysui/*.proto",
150    "atoms/tv/*.proto",
151    "atoms/usb/*.proto",
152    "atoms/providers/mediaprovider/*.proto",
153    "atoms/photopicker/*.proto",
154    "atoms/devicelogs/*.proto",
155    "atoms/kernel/*.proto",
156    "atoms/wearservices/*.proto",
157    "atoms/wear/media/*.proto",
158    "atoms/wear/prototiles/*.proto",
159    "atoms/media/*.proto",
160    "atoms/adservices/*.proto",
161    "atoms/wear/modes/*.proto",
162    "atoms/wearpas/*.proto",
163    "atoms/statsd/*.proto",
164    "atoms/telecomm/*.proto",
165    "atoms/telephony/qns/*.proto",
166    "atoms/telephony/*.proto",
167    "atoms/memorysafety/*.proto",
168    "atoms/wifi/*.proto",
169    "atoms/telephony/satellite/*.proto",
170    "atoms/telephony/security/*.proto",
171    "atoms/automotive/caruilib/*.proto",
172    "atoms/uwb/*.proto",
173    "atoms/ondevicepersonalization/*.proto",
174    "atoms/federatedcompute/*.proto",
175    "atoms/wear/connectivity/*.proto",
176    "atoms/devicelock/*.proto",
177    "atoms/cpu/*.proto",
178    "atoms/sdksandbox/*.proto",
179    "atoms/selinux/*.proto",
180    "atoms/threadnetwork/*.proto",
181    "atoms/automotive/carlauncher/*.proto",
182    "atoms/transparency/*.proto",
183    "atoms/desktopmode/*.proto",
184    "atoms/adaptiveauth/*.proto",
185    "atoms/automotive/carpower/*.proto",
186    "atoms/camera/*.proto",
187]
188
189cc_library_host_shared {
190    name: "libstats_proto_host",
191    srcs: [
192        "atom_field_options.proto",
193        ":libstats_atom_message_protos",
194    ] + shared_enum_protos + enum_protos + atom_protos,
195
196    cflags: [
197        "-Wno-deprecated-declarations",
198    ],
199
200    proto: {
201        type: "full",
202        export_proto_headers: true,
203        include_dirs: [
204            "external/protobuf/src",
205        ],
206    },
207}
208
209filegroup {
210    name: "libstats_atoms_proto",
211    srcs: atom_protos,
212}
213
214filegroup {
215    name: "libstats_internal_protos",
216    srcs: [
217        ":libstats_atoms_proto",
218        "atom_field_options.proto",
219        ":libstats_atom_enum_protos",
220        ":libstats_atom_message_protos",
221    ],
222}
223
224filegroup {
225    name: "libstats_atom_options_protos",
226    srcs: [
227        "atom_field_options.proto",
228    ],
229}
230
231filegroup {
232    name: "libstats_shared_enum_protos",
233    srcs: shared_enum_protos,
234}
235
236filegroup {
237    name: "libstats_atom_enum_protos",
238    srcs: shared_enum_protos + enum_protos,
239}
240
241filegroup {
242    name: "libstats_atom_message_protos",
243    srcs: [
244        "message/*.proto",
245    ],
246}
247