• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// List of clang-tidy checks that are reported as errors.
2// Please keep this list ordered lexicographically.
3package {
4    default_applicable_licenses: ["Android-Apache-2.0"],
5}
6
7tidy_errors = [
8    "android-*",
9    "bugprone-infinite-loop",
10    "bugprone-macro-parentheses",
11    "bugprone-misplaced-widening-cast",
12    "bugprone-move-forwarding-reference",
13    "bugprone-sizeof-container",
14    "bugprone-sizeof-expression",
15    "bugprone-string-constructor",
16    "bugprone-terminating-continue",
17    "bugprone-undefined-memory-manipulation",
18    "bugprone-undelegated-constructor",
19    // "bugprone-unhandled-self-assignment", // found in apex_manifest.proto
20    "bugprone-unused-raii",
21    "cert-err34-c",
22    "google-default-arguments",
23    // "google-explicit-constructor", // found in com_android_apex.h
24    "google-readability-avoid-underscore-in-googletest-name",
25    "google-readability-todo",
26    "google-runtime-int",
27    "google-runtime-member-string-references",
28    "misc-move-const-arg",
29    "misc-move-forwarding-reference",
30    // "misc-unused-parameters", // found in apexd_utils.h
31    "misc-unused-using-decls",
32    "misc-use-after-move",
33    // "modernize-pass-by-value", // found in apex_database.h
34    "performance-faster-string-find",
35    "performance-for-range-copy",
36    "performance-implicit-conversion-in-loop",
37    "performance-inefficient-vector-operation",
38    "performance-move-const-arg",
39    // "performance-move-constructor-init", // found in apexd_loop.h
40    "performance-noexcept-move-constructor",
41    "performance-unnecessary-copy-initialization",
42    "performance-unnecessary-value-param",
43    // "readability-avoid-const-params-in-decls", // found in apexd.h
44]
45
46cc_defaults {
47    name: "apex_flags_defaults",
48    cflags: [
49        "-Wall",
50        "-Wextra",
51        "-Werror",
52        "-Wno-unused-parameter",
53
54        // Some extra flags.
55        "-fstrict-aliasing",
56        "-Wredundant-decls",
57        "-Wshadow",
58        "-Wstrict-aliasing",
59        "-Wthread-safety",
60        "-Wthread-safety-negative",
61        "-Wunreachable-code",
62        "-Wunreachable-code-break",
63        "-Wunreachable-code-return",
64        "-Wunused",
65        "-Wused-but-marked-unused",
66    ] + select(release_flag("RELEASE_AVF_ENABLE_EARLY_VM"), {
67        true: ["-DRELEASE_AVF_ENABLE_EARLY_VM"],
68        default: [],
69    }),
70    tidy: true,
71    tidy_checks: tidy_errors,
72    tidy_checks_as_errors: tidy_errors,
73    tidy_flags: [
74        "-format-style=file",
75        "-header-filter=system/apex/",
76    ],
77}
78
79cc_defaults {
80    name: "libapexd-deps",
81    defaults: ["libapex-deps"],
82    shared_libs: [
83        "libfs_mgr",
84        "liblog",
85        "liblogwrap",
86        "libvintf",
87    ],
88    static_libs: [
89        "lib_apex_blocklist_proto",
90        "lib_microdroid_metadata_proto",
91        "libapex",
92        "libavb",
93        "libdm",
94        "libext2_uuid",
95        "libsigningutils",
96        "libtinyxml2",
97        "libverity_tree",
98        "libvold_binder",
99    ],
100    whole_static_libs: ["libcom.android.sysprop.apex"],
101}
102
103aidl_interface {
104    name: "apex_aidl_interface",
105    unstable: true,
106    srcs: [
107        "aidl/android/apex/ApexInfo.aidl",
108        "aidl/android/apex/ApexInfoList.aidl",
109        "aidl/android/apex/ApexSessionInfo.aidl",
110        "aidl/android/apex/ApexSessionParams.aidl",
111        "aidl/android/apex/CompressedApexInfo.aidl",
112        "aidl/android/apex/CompressedApexInfoList.aidl",
113        "aidl/android/apex/IApexService.aidl",
114    ],
115    local_include_dir: "aidl",
116    backend: {
117        java: {
118            sdk_version: "28",
119        },
120        ndk: {
121            enabled: false,
122        },
123        rust: {
124            enabled: true,
125        },
126    },
127}
128
129cc_binary {
130    name: "apexd",
131    defaults: [
132        "apex_flags_defaults",
133        "libapex-deps",
134        "libapexd-deps",
135        "libapexservice-deps",
136        "libapexd_metrics_stats-deps",
137    ],
138    srcs: [
139        "apexd_main.cpp",
140    ],
141    shared_libs: [
142        "server_configurable_flags",
143        "apexd_flags_c_lib",
144    ],
145    static_libs: [
146        "libapex",
147        "libapexd",
148        "libapexd_checkpoint_vold",
149        "libapexservice",
150        "libapexd_metrics_stats",
151    ],
152    init_rc: ["apexd.rc"],
153    // Just like the init, apexd should be able to run without
154    // any APEX activated. To do so, it uses the bootstrap linker
155    // and the bootstrap bionic libraries.
156    bootstrap: true,
157}
158
159cc_binary {
160    name: "apexd.microdroid",
161    defaults: [
162        "apex_flags_defaults",
163        "libapex-deps",
164        "libapexd-deps",
165    ],
166    srcs: [
167        "apexd_microdroid.cpp",
168    ],
169    static_libs: [
170        "libapex",
171        "libapexd",
172        // Prefer static-link as, in microdroid, apexd is the only client.
173        // Using the -ndk variant since libprotobuf-cpp-full is supposed to be
174        // used as a shared lib in general in Android.
175        "libprotobuf-cpp-full-ndk",
176    ],
177    exclude_shared_libs: [
178        "libfs_mgr",
179        "libprotobuf-cpp-full",
180        "libvintf",
181    ],
182    // Just like the init, apexd should be able to run without
183    // any APEX activated. To do so, it uses the bootstrap linker
184    // and the bootstrap bionic libraries.
185    bootstrap: true,
186    // This variant is for microdroid.
187    no_full_install: true,
188    // init depends on the name "apexd".
189    stem: "apexd",
190}
191
192cc_library_static {
193    name: "libapexd",
194    defaults: [
195        "apex_flags_defaults",
196        "libapexd-deps",
197    ],
198    srcs: [
199        "apex_blocklist.cpp",
200        "apex_classpath.cpp",
201        "apex_database.cpp",
202        "apex_file_repository.cpp",
203        "apexd_brand_new_verifier.cpp",
204        "apexd.cpp",
205        "apexd_dm.cpp",
206        "apexd_image_manager.cpp",
207        "apexd_lifecycle.cpp",
208        "apexd_loop.cpp",
209        "apexd_metrics.cpp",
210        "apexd_private.cpp",
211        "apexd_session.cpp",
212        "apexd_verity.cpp",
213        "apexd_vendor_apex.cpp",
214    ],
215    export_include_dirs: ["."],
216    generated_sources: ["apex-info-list-tinyxml"],
217    // Don't add shared/static libs here; add to libapexd_defaults instead.
218}
219
220cc_library_static {
221    name: "libapexd_checkpoint_vold",
222    defaults: ["apex_flags_defaults"],
223    srcs: ["apexd_checkpoint_vold.cpp"],
224    shared_libs: [
225        "libbase",
226        "libutils",
227    ],
228    static_libs: [
229        "libvold_binder",
230    ],
231    export_include_dirs: ["."],
232}
233
234cc_defaults {
235    name: "libapexservice-deps",
236    shared_libs: [
237        "apex_aidl_interface-cpp",
238        "libbinder",
239        "libutils",
240    ],
241}
242
243cc_library_static {
244    name: "libapexservice",
245    defaults: [
246        "apex_flags_defaults",
247        "libapexd-deps",
248        "libapexservice-deps",
249    ],
250    srcs: ["apexservice.cpp"],
251    static_libs: [
252        "libapexd",
253    ],
254    cflags: [
255        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
256    ],
257}
258
259cc_defaults {
260    name: "libapex-deps",
261    shared_libs: [
262        "libbase",
263        "libcrypto",
264        "libcutils",
265        "libprotobuf-cpp-full",
266        "libziparchive",
267        "libselinux",
268    ],
269    static_libs: [
270        "lib_apex_session_state_proto",
271        "lib_apex_manifest_proto",
272        "libavb",
273    ],
274    cpp_std: "experimental",
275}
276
277cc_library_static {
278    name: "libapex",
279    defaults: [
280        "apex_flags_defaults",
281        "libapex-deps",
282    ],
283    srcs: [
284        "apex_file.cpp",
285        "apex_manifest.cpp",
286        "apex_sha.cpp",
287        "apex_shim.cpp",
288        "apexd_verity.cpp",
289    ],
290    host_supported: true,
291    target: {
292        darwin: {
293            enabled: false,
294        },
295    },
296    header_libs: [
297        "libutils_headers",
298    ],
299    export_header_lib_headers: [
300        "libutils_headers",
301    ],
302    export_include_dirs: ["."],
303}
304
305java_genrule {
306    // Generates an apex which has a different manifest outside the filesystem
307    // image.
308    name: "gen_manifest_mismatch_apex",
309    out: ["apex.apexd_test_manifest_mismatch.apex"],
310    srcs: [":apex.apexd_test"],
311    tools: [
312        "soong_zip",
313        "zipalign",
314        "conv_apex_manifest",
315    ],
316    cmd: "unzip -q $(in) -d $(genDir) && " +
317        "$(location conv_apex_manifest) setprop version 137 $(genDir)/apex_manifest.pb && " +
318        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
319        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
320        "-o $(genDir)/unaligned.apex && " +
321        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
322        "$(genDir)/apex.apexd_test_manifest_mismatch.apex",
323}
324
325java_genrule {
326    // Generates an apex with a corrupted filesystem superblock, which should cause
327    // Apex::Open to fail
328    name: "gen_corrupt_superblock_apex",
329    out: ["apex.apexd_test_corrupt_superblock_apex.apex"],
330    srcs: [":apex.apexd_test"],
331    tools: [
332        "soong_zip",
333        "zipalign",
334    ],
335    cmd: "unzip -q $(in) -d $(genDir) && " +
336        "dd if=/dev/zero of=$(genDir)/apex_payload.img conv=notrunc bs=1024 seek=1 count=1 && " +
337        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
338        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
339        "-o $(genDir)/unaligned.apex && " +
340        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
341        "$(genDir)/apex.apexd_test_corrupt_superblock_apex.apex",
342}
343
344java_genrule {
345    // Generates an apex with a corrupted filesystem image, which should cause
346    // dm-verity verification to fail
347    name: "gen_corrupt_apex",
348    out: ["apex.apexd_test_corrupt_apex.apex"],
349    srcs: [":apex.apexd_test_for_corruption"],
350    tools: [
351        "soong_zip",
352        "zipalign",
353    ],
354    cmd: "unzip -q $(in) -d $(genDir) && " +
355        "dd if=/dev/zero of=$(genDir)/apex_payload.img conv=notrunc bs=1024 seek=16 count=1 && " +
356        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
357        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
358        "-o $(genDir)/unaligned.apex && " +
359        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
360        "$(genDir)/apex.apexd_test_corrupt_apex.apex",
361}
362
363java_genrule {
364    // Extract the root digest with avbtool
365    name: "apex.apexd_test_digest",
366    out: ["apex.apexd_test_digest.txt"],
367    srcs: [":apex.apexd_test"],
368    tools: ["avbtool"],
369    cmd: "unzip -q $(in) -d $(genDir) apex_payload.img && " +
370        "$(location avbtool) print_partition_digests --image $(genDir)/apex_payload.img " +
371        "| cut -c 3-| tee $(out)",
372}
373
374java_genrule {
375    // Extract the root digest with avbtool
376    name: "apex.apexd_test_f2fs_digest",
377    out: ["apex.apexd_test_f2fs_digest.txt"],
378    srcs: [":apex.apexd_test_f2fs"],
379    tools: ["avbtool"],
380    cmd: "unzip -q $(in) -d $(genDir) apex_payload.img && " +
381        "$(location avbtool) print_partition_digests --image $(genDir)/apex_payload.img " +
382        "| cut -c 3-| tee $(out)",
383}
384
385java_genrule {
386    // Extract the root digest with avbtool
387    name: "apex.apexd_test_erofs_digest",
388    out: ["apex.apexd_test_erofs_digest.txt"],
389    srcs: [":apex.apexd_test_erofs"],
390    tools: ["avbtool"],
391    cmd: "unzip -q $(in) -d $(genDir) apex_payload.img && " +
392        "$(location avbtool) print_partition_digests --image $(genDir)/apex_payload.img " +
393        "| cut -c 3-| tee $(out)",
394}
395
396java_genrule {
397    // Generates an apex which has same module name as apex.apexd_test.apex, but
398    // is actually signed with a different key.
399    name: "gen_key_mismatch_apex",
400    out: ["apex.apexd_test_different_key.apex"],
401    srcs: [":apex.apexd_test_no_inst_key"],
402    tools: [
403        "soong_zip",
404        "zipalign",
405        "conv_apex_manifest",
406    ],
407    cmd: "unzip -q $(in) -d $(genDir) && " +
408        "$(location conv_apex_manifest) setprop name com.android.apex.test_package $(genDir)/apex_manifest.pb && " +
409        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
410        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
411        "-o $(genDir)/unaligned.apex && " +
412        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
413        "$(genDir)/apex.apexd_test_different_key.apex",
414}
415
416java_genrule {
417    // Generates an apex which has same module name as apex.apexd_test.apex, but
418    // is actually signed with a different key.
419    name: "gen_key_mismatch_apex_v2",
420    out: ["apex.apexd_test_different_key_v2.apex"],
421    srcs: [":apex.apexd_test_no_inst_key"],
422    tools: [
423        "soong_zip",
424        "zipalign",
425        "conv_apex_manifest",
426    ],
427    cmd: "unzip -q $(in) -d $(genDir) && " +
428        "$(location conv_apex_manifest) setprop name com.android.apex.test_package $(genDir)/apex_manifest.pb && " +
429        "$(location conv_apex_manifest) setprop version 2 $(genDir)/apex_manifest.pb && " +
430        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
431        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
432        "-o $(genDir)/unaligned.apex && " +
433        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
434        "$(genDir)/apex.apexd_test_different_key_v2.apex",
435}
436
437java_genrule {
438    // Generates an apex which has a different manifest outside the filesystem
439    // image.
440    name: "gen_manifest_mismatch_rebootless_apex",
441    out: ["test.rebootless_apex_manifest_mismatch.apex"],
442    srcs: [":test.rebootless_apex_v1"],
443    tools: [
444        "soong_zip",
445        "zipalign",
446        "conv_apex_manifest",
447    ],
448    cmd: "unzip -q $(in) -d $(genDir) && " +
449        "$(location conv_apex_manifest) setprop version 137 $(genDir)/apex_manifest.pb && " +
450        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
451        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
452        "-o $(genDir)/unaligned.apex && " +
453        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
454        "$(genDir)/test.rebootless_apex_manifest_mismatch.apex",
455}
456
457java_genrule {
458    // Generates an apex with a corrupted filesystem image, which should cause
459    // dm-verity verification to fail
460    name: "gen_corrupt_rebootless_apex",
461    out: ["test.rebootless_apex_corrupted.apex"],
462    srcs: [":test.rebootless_apex_v1"],
463    tools: [
464        "soong_zip",
465        "zipalign",
466    ],
467    cmd: "unzip -q $(in) -d $(genDir) && " +
468        "dd if=/dev/zero of=$(genDir)/apex_payload.img conv=notrunc bs=1024 seek=16 count=1 && " +
469        "$(location soong_zip) -d -C $(genDir) -D $(genDir) " +
470        "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " +
471        "-o $(genDir)/unaligned.apex && " +
472        "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " +
473        "$(genDir)/test.rebootless_apex_corrupted.apex",
474}
475
476cc_test {
477    name: "ApexTestCases",
478    defaults: [
479        "apex_flags_defaults",
480        "libapex-deps",
481        "libapexd-deps",
482    ],
483    require_root: true,
484    cflags: [
485        // Otherwise libgmock won't compile.
486        "-Wno-used-but-marked-unused",
487    ],
488    data: [
489        ":apex.apexd_bootstrap_test",
490        ":apex.apexd_test",
491        ":apex.apexd_test_erofs",
492        ":apex.apexd_test_f2fs",
493        ":apex.apexd_test_digest",
494        ":apex.apexd_test_erofs_digest",
495        ":apex.apexd_test_f2fs_digest",
496        ":apex.apexd_test_classpath",
497        ":apex.apexd_test_different_app",
498        ":apex.apexd_test_no_inst_key",
499        ":apex.apexd_test_f2fs_no_inst_key",
500        ":apex.apexd_test_nocode",
501        ":apex.apexd_test_v2",
502        ":apex.corrupted_b146895998",
503        ":apex.banned_name",
504        ":gen_key_mismatch_apex",
505        ":gen_key_mismatch_apex_v2",
506        ":gen_key_mismatch_capex",
507        ":gen_manifest_mismatch_apex",
508        ":gen_corrupt_superblock_apex",
509        ":gen_corrupt_apex",
510        ":gen_capex_not_decompressible",
511        ":gen_capex_without_apex",
512        ":gen_capex_with_v2_apex",
513        ":gen_key_mismatch_with_original_capex",
514        ":com.android.apex.brand.new",
515        ":com.android.apex.brand.new.v2",
516        ":com.android.apex.brand.new.v2.diffkey",
517        ":com.android.apex.cts.shim.v1_prebuilt",
518        ":com.android.apex.cts.shim.v2_prebuilt",
519        ":com.android.apex.cts.shim.v2_wrong_sha_prebuilt",
520        ":com.android.apex.cts.shim.v2_additional_file_prebuilt",
521        ":com.android.apex.cts.shim.v2_additional_folder_prebuilt",
522        ":com.android.apex.cts.shim.v2_with_pre_install_hook_prebuilt",
523        ":com.android.apex.cts.shim.v2_with_post_install_hook_prebuilt",
524        ":com.android.apex.compressed_sharedlibs",
525        ":com.android.apex.compressed.v1",
526        ":com.android.apex.compressed.v1_different_digest",
527        ":com.android.apex.compressed.v1_different_digest_original",
528        ":com.android.apex.compressed.v1{.apex}",
529        ":com.android.apex.compressed.v2",
530        ":com.android.apex.compressed.v2_original",
531        ":gen_manifest_mismatch_compressed_apex_v2",
532        "apexd_testdata/com.android.apex.test_package.avbpubkey",
533        "apexd_testdata/com.android.apex.compressed.avbpubkey",
534        "apexd_testdata/com.android.apex.brand.new.avbpubkey",
535        "apexd_testdata/com.android.apex.brand.new.another.avbpubkey",
536        "apexd_testdata/com.android.apex.brand.new.renamed.avbpubkey",
537        "apexd_testdata/blocklist.json",
538        "apexd_testdata/blocklist_invalid.json",
539        ":com.android.apex.test.sharedlibs_generated.v1.libvX_prebuilt",
540        ":com.android.apex.test.sharedlibs_generated.v2.libvY_prebuilt",
541        ":test.rebootless_apex_v1",
542        ":test.rebootless_apex_v2",
543        ":test.rebootless_apex_service_v1",
544        ":test.rebootless_apex_service_v2",
545        ":gen_manifest_mismatch_rebootless_apex",
546        ":gen_corrupt_rebootless_apex",
547        ":test.rebootless_apex_provides_sharedlibs",
548        ":test.rebootless_apex_provides_native_libs",
549        ":test.rebootless_apex_requires_shared_apex_libs",
550        ":test.rebootless_apex_jni_libs",
551        ":test.rebootless_apex_add_native_lib",
552        ":test.rebootless_apex_remove_native_lib",
553        ":test.rebootless_apex_app_in_apex",
554        ":test.rebootless_apex_priv_app_in_apex",
555        ":com.android.apex.vendor.foo",
556        ":com.android.apex.vendor.foo.with_vintf",
557    ],
558    srcs: [
559        "apex_blocklist_test.cpp",
560        "apex_classpath_test.cpp",
561        "apex_database_test.cpp",
562        "apex_file_test.cpp",
563        "apex_file_repository_test.cpp",
564        "apex_manifest_test.cpp",
565        "apexd_brand_new_verifier_test.cpp",
566        "apexd_image_manager_test.cpp",
567        "apexd_test.cpp",
568        "apexd_session_test.cpp",
569        "apexd_utils_test.cpp",
570    ],
571    host_supported: false,
572    compile_multilib: "first",
573    static_libs: [
574        "apex_aidl_interface-cpp",
575        "libapex",
576        "libapexd",
577        "libfstab",
578        "libgmock",
579    ],
580    shared_libs: [
581        "libbinder",
582        "libfs_mgr",
583        "libutils",
584    ],
585    generated_sources: ["apex-info-list-tinyxml"],
586    test_suites: ["device-tests"],
587    test_config: "ApexTestCases.xml",
588}
589
590cc_test {
591    name: "ApexServiceTestCases",
592    defaults: [
593        "apex_flags_defaults",
594        "libapex-deps",
595        "libapexd-deps",
596    ],
597    require_root: true,
598    cflags: [
599        // Otherwise libgmock won't compile.
600        "-Wno-used-but-marked-unused",
601    ],
602    data: [
603        ":apex.apexd_test",
604        ":apex.apexd_test_classpath",
605        ":apex.apexd_test_different_app",
606        ":apex.apexd_test_no_inst_key",
607        ":apex.apexd_test_f2fs_no_inst_key",
608        ":apex.apexd_test_nocode",
609        ":apex.apexd_test_v2",
610        ":apex.corrupted_b146895998",
611        ":apex.banned_name",
612        ":gen_key_mismatch_apex",
613        ":gen_key_mismatch_apex_v2",
614        ":gen_key_mismatch_capex",
615        ":gen_manifest_mismatch_apex",
616        ":gen_corrupt_superblock_apex",
617        ":gen_corrupt_apex",
618        ":gen_capex_not_decompressible",
619        ":gen_capex_without_apex",
620        ":gen_capex_with_v2_apex",
621        ":gen_key_mismatch_with_original_capex",
622        ":com.android.apex.cts.shim.v1_prebuilt",
623        ":com.android.apex.cts.shim.v2_prebuilt",
624        ":com.android.apex.cts.shim.v2_wrong_sha_prebuilt",
625        ":com.android.apex.cts.shim.v2_additional_file_prebuilt",
626        ":com.android.apex.cts.shim.v2_additional_folder_prebuilt",
627        ":com.android.apex.cts.shim.v2_with_pre_install_hook_prebuilt",
628        ":com.android.apex.cts.shim.v2_with_post_install_hook_prebuilt",
629        ":com.android.apex.compressed_sharedlibs",
630        ":com.android.apex.compressed.v1",
631        ":com.android.apex.compressed.v1_different_digest",
632        ":com.android.apex.compressed.v1_different_digest_original",
633        ":com.android.apex.compressed.v1{.apex}",
634        ":com.android.apex.compressed.v2",
635        ":com.android.apex.compressed.v2_original",
636        ":gen_manifest_mismatch_compressed_apex_v2",
637        "apexd_testdata/com.android.apex.test_package.avbpubkey",
638        "apexd_testdata/com.android.apex.compressed.avbpubkey",
639        ":com.android.apex.test.sharedlibs_generated.v1.libvX_prebuilt",
640        ":com.android.apex.test.sharedlibs_generated.v2.libvY_prebuilt",
641        ":test.rebootless_apex_v1",
642        ":test.rebootless_apex_v2",
643        ":test.rebootless_apex_service_v1",
644        ":test.rebootless_apex_service_v2",
645        ":gen_manifest_mismatch_rebootless_apex",
646        ":gen_corrupt_rebootless_apex",
647        ":test.rebootless_apex_provides_sharedlibs",
648        ":test.rebootless_apex_provides_native_libs",
649        ":test.rebootless_apex_requires_shared_apex_libs",
650        ":test.rebootless_apex_jni_libs",
651        ":test.rebootless_apex_add_native_lib",
652        ":test.rebootless_apex_remove_native_lib",
653        ":test.rebootless_apex_app_in_apex",
654        ":test.rebootless_apex_priv_app_in_apex",
655    ],
656    srcs: [
657        "apexservice_test.cpp",
658    ],
659    host_supported: false,
660    compile_multilib: "first",
661    static_libs: [
662        "apex_aidl_interface-cpp",
663        "libapex",
664        "libapexd",
665        "libfstab",
666        "libgmock",
667    ],
668    shared_libs: [
669        "libbinder",
670        "libfs_mgr",
671        "libutils",
672    ],
673    generated_sources: ["apex-info-list-tinyxml"],
674    test_suites: ["device-tests"],
675    test_config: "ApexServiceTestCases.xml",
676}
677
678xsd_config {
679    name: "apex-info-list",
680    srcs: ["ApexInfoList.xsd"],
681    package_name: "com.android.apex",
682    api_dir: "apex-info-list-api",
683    gen_writer: true,
684    root_elements: ["apex-info-list"],
685}
686
687xsd_config {
688    name: "apex-info-list-tinyxml",
689    srcs: ["ApexInfoList.xsd"],
690    package_name: "com.android.apex",
691    api_dir: "apex-info-list-api",
692    gen_writer: true,
693    tinyxml: true,
694    root_elements: ["apex-info-list"],
695}
696
697cc_defaults {
698    name: "libapexd_metrics_stats-deps",
699    shared_libs: [
700        "libbase",
701        "libbinder",
702        "libutils",
703        "liblog",
704    ],
705    static_libs: [
706        "android.os.statsbootstrap_aidl-cpp",
707        "libstatsbootstrap",
708    ],
709}
710
711cc_library_static {
712    name: "libapexd_metrics_stats",
713    defaults: [
714        "libapexd_metrics_stats-deps",
715    ],
716    srcs: [
717        "apexd_metrics_stats.cpp",
718    ],
719    generated_sources: [
720        "statslog_apex.cpp",
721    ],
722    generated_headers: [
723        "statslog_apex.h",
724    ],
725    cflags: [
726        "-Wall",
727        "-Werror",
728    ],
729}
730
731genrule {
732    name: "statslog_apex.h",
733    tools: ["stats-log-api-gen"],
734    cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_apex.h --module apex --namespace stats,apex --bootstrap",
735    out: [
736        "statslog_apex.h",
737    ],
738}
739
740genrule {
741    name: "statslog_apex.cpp",
742    tools: ["stats-log-api-gen"],
743    cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_apex.cpp --module apex --namespace stats,apex --importHeader statslog_apex.h --bootstrap",
744    out: [
745        "statslog_apex.cpp",
746    ],
747}
748
749aconfig_declarations {
750    name: "apexd_flags",
751    package: "com.android.apex.flags",
752    srcs: ["apexd.aconfig"],
753    container: "system",
754}
755
756cc_aconfig_library {
757    name: "apexd_flags_c_lib",
758    aconfig_declarations: "apexd_flags",
759}
760