1//
2// Copyright (C) 2017 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
17package {
18    default_team: "trendy_team_fwk_core_networking",
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22cc_library {
23    name: "libnetworkstats",
24    vendor_available: false,
25    host_supported: false,
26    header_libs: ["bpf_connectivity_headers"],
27    srcs: [
28        "BpfNetworkStats.cpp",
29        "NetworkTraceHandler.cpp",
30        "NetworkTracePoller.cpp",
31    ],
32    shared_libs: [
33        "libbase",
34        "libcutils",
35        "liblog",
36    ],
37    static_libs: [
38        "libperfetto_client_experimental",
39    ],
40    export_static_lib_headers: [
41        "libperfetto_client_experimental",
42    ],
43    export_include_dirs: ["include"],
44    cflags: [
45        "-Wall",
46        "-Werror",
47        "-Wno-unused-parameter",
48        "-Wthread-safety",
49    ],
50    sanitize: {
51        cfi: true,
52    },
53    apex_available: [
54        "com.android.tethering",
55    ],
56    min_sdk_version: "30",
57}
58
59cc_test {
60    name: "libnetworkstats_test",
61    test_suites: [
62        "general-tests",
63        "mts-tethering",
64    ],
65    test_config_template: ":net_native_test_config_template",
66    require_root: true, // required by setrlimitForTest()
67    header_libs: ["bpf_connectivity_headers"],
68    srcs: [
69        "BpfNetworkStatsTest.cpp",
70        "NetworkTraceHandlerTest.cpp",
71        "NetworkTracePollerTest.cpp",
72    ],
73    cflags: [
74        "-Wall",
75        "-Werror",
76        "-Wno-unused-parameter",
77        "-Wthread-safety",
78    ],
79    version_script: ":connectivity_mainline_test_map",
80    stl: "libc++_static",
81    static_libs: [
82        "libbase",
83        "libgmock",
84        "libnetworkstats",
85        "libperfetto_client_experimental",
86        "libprotobuf-cpp-lite",
87        "perfetto_trace_protos",
88    ],
89    shared_libs: [
90        "liblog",
91        "libcutils",
92        "libandroid_net",
93    ],
94    compile_multilib: "both",
95    multilib: {
96        lib32: {
97            suffix: "32",
98        },
99        lib64: {
100            suffix: "64",
101        },
102    },
103}
104