1package {
2    default_applicable_licenses: ["system_netd_license"],
3}
4
5// Added automatically by a large-scale-change
6// See: http://go/android-license-faq
7license {
8    name: "system_netd_license",
9    visibility: [":__subpackages__"],
10    license_kinds: [
11        "SPDX-license-identifier-Apache-2.0",
12    ],
13    license_text: [
14        "NOTICE",
15    ],
16}
17
18cc_library_headers {
19    name: "libnetd_client_headers",
20    export_include_dirs: ["include"],
21    apex_available: [
22        "//apex_available:platform",
23        "com.android.tethering",
24    ],
25}
26
27cc_library_headers {
28    name: "libnetdbinder_utils_headers",
29    export_include_dirs: ["include/binder_utils"],
30    apex_available: [
31        "//apex_available:platform",
32        "com.android.resolv",
33    ],
34    min_sdk_version: "29",
35}
36
37cc_defaults {
38    name: "netd_defaults",
39    cflags: [
40        "-Wall",
41        "-Werror",
42        // Override -Wno-error=implicit-fallthrough from soong
43        "-Werror=implicit-fallthrough",
44        "-Werror=sometimes-uninitialized",
45        "-Werror=conditional-uninitialized",
46        "-Wnullable-to-nonnull-conversion",
47        "-Wsign-compare",
48        "-Wthread-safety",
49        "-Wunused-parameter",
50        "-Wuninitialized",
51    ],
52    tidy: true,
53    cpp_std: "experimental",
54    tidy_checks: [
55        "android-*",
56        "bugprone-*",
57        "cert-*",
58        "clang-analyzer-security*",
59        "google-*",
60        "misc-*",
61        "performance-*",
62        "-bugprone-macro-parentheses",
63        "-bugprone-narrowing-conversions",  // lots of unsigned -> int conversions
64        "-bugprone-unhandled-self-assignment", // found in DnsResolver/stats.pb.h
65        "-cert-dcl50-cpp",
66        "-cert-err34-c",  // TODO: re-enable after removing atoi() and sscanf() calls
67        "-cert-oop54-cpp", // found in DnsResolver/stats.pb.h
68        "-google-default-arguments",
69        "-google-explicit-constructor",
70        "-google-global-names-in-headers",
71        "-google-readability-*",  // Too pedantic
72        "-google-runtime-int",  // Too many unavoidable warnings due to strtol()
73        "-google-runtime-references",  // Grandfathered usage of pass by non-const reference
74        "-misc-non-private-member-variables-in-classes",  // Also complains about structs
75        "-performance-noexcept-move-constructor",
76        "-performance-unnecessary-value-param",
77        "-performance-no-int-to-ptr",
78    ],
79    tidy_flags: [
80        "-warnings-as-errors="
81        + "android-*,"
82        + "bugprone-*,"
83        + "cert-*,"
84        + "clang-analyzer-security*,"
85        + "google-*,"
86        + "misc-*,"
87        + "performance-*"
88    ],
89}
90