blob: 5cb27e6b47c7e3e37e72962164c2f3763d59bf99 [file] [log] [blame]
Ken Chenf2bb7b12022-01-22 19:17:20 +08001//
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 {
Ken Chenf426b2b2022-01-23 15:39:13 +080018 default_applicable_licenses: ["Android-Apache-2.0"],
Ken Chenf2bb7b12022-01-22 19:17:20 +080019}
20
21cc_library {
Ken Chenf426b2b2022-01-23 15:39:13 +080022 name: "libnetworkstats",
Ken Chenf2bb7b12022-01-22 19:17:20 +080023 vendor_available: false,
24 host_supported: false,
25 header_libs: ["bpf_connectivity_headers"],
26 srcs: [
Ryan Zuklie0b9478b2023-01-10 13:45:39 -080027 "BpfNetworkStats.cpp",
28 "NetworkTraceHandler.cpp",
Ken Chenf2bb7b12022-01-22 19:17:20 +080029 ],
30 shared_libs: [
31 "libbase",
32 "liblog",
Ken Chenf2bb7b12022-01-22 19:17:20 +080033 ],
34 export_include_dirs: ["include"],
Ken Chenf426b2b2022-01-23 15:39:13 +080035 cflags: [
36 "-Wall",
37 "-Werror",
38 "-Wno-unused-parameter",
39 "-Wthread-safety",
40 ],
Ken Chenf2bb7b12022-01-22 19:17:20 +080041 sanitize: {
42 cfi: true,
43 },
Ken Chenf426b2b2022-01-23 15:39:13 +080044 apex_available: [
Ken Chenf426b2b2022-01-23 15:39:13 +080045 "com.android.tethering",
46 ],
47 min_sdk_version: "30",
Ken Chenf2bb7b12022-01-22 19:17:20 +080048}
49
50cc_test {
Ken Chenf426b2b2022-01-23 15:39:13 +080051 name: "libnetworkstats_test",
Ken Chenb9266bf2022-05-25 15:34:17 +080052 test_suites: ["general-tests", "mts-tethering"],
53 test_config_template: ":net_native_test_config_template",
Ken Chenf426b2b2022-01-23 15:39:13 +080054 require_root: true, // required by setrlimitForTest()
Ken Chenf2bb7b12022-01-22 19:17:20 +080055 header_libs: ["bpf_connectivity_headers"],
56 srcs: [
57 "BpfNetworkStatsTest.cpp",
Ryan Zuklie0b9478b2023-01-10 13:45:39 -080058 "NetworkTraceHandlerTest.cpp",
Ken Chenf2bb7b12022-01-22 19:17:20 +080059 ],
Ken Chenf426b2b2022-01-23 15:39:13 +080060 cflags: [
61 "-Wall",
62 "-Werror",
63 "-Wno-unused-parameter",
64 "-Wthread-safety",
65 ],
Lorenzo Colitti0db496e2022-02-07 09:01:37 +090066 static_libs: [
67 "libgmock",
68 "libnetworkstats",
69 ],
Ken Chenf2bb7b12022-01-22 19:17:20 +080070 shared_libs: [
71 "libbase",
72 "liblog",
Ryan Zuklie0b9478b2023-01-10 13:45:39 -080073 "libandroid_net",
Ken Chenf2bb7b12022-01-22 19:17:20 +080074 ],
Ken Chenb9266bf2022-05-25 15:34:17 +080075 compile_multilib: "both",
76 multilib: {
77 lib32: {
78 suffix: "32",
79 },
80 lib64: {
81 suffix: "64",
82 },
83 },
Ken Chenf2bb7b12022-01-22 19:17:20 +080084}