blob: bf56fd5609ada2cba3f2d776b05798f28f32fde7 [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: [
27 "BpfNetworkStats.cpp"
28 ],
29 shared_libs: [
30 "libbase",
31 "liblog",
Ken Chenf2bb7b12022-01-22 19:17:20 +080032 ],
33 export_include_dirs: ["include"],
Ken Chenf426b2b2022-01-23 15:39:13 +080034 cflags: [
35 "-Wall",
36 "-Werror",
37 "-Wno-unused-parameter",
38 "-Wthread-safety",
39 ],
Ken Chenf2bb7b12022-01-22 19:17:20 +080040 sanitize: {
41 cfi: true,
42 },
Ken Chenf426b2b2022-01-23 15:39:13 +080043 apex_available: [
Ken Chenf426b2b2022-01-23 15:39:13 +080044 "com.android.tethering",
45 ],
46 min_sdk_version: "30",
Ken Chenf2bb7b12022-01-22 19:17:20 +080047}
48
49cc_test {
Ken Chenf426b2b2022-01-23 15:39:13 +080050 name: "libnetworkstats_test",
51 test_suites: ["general-tests"],
52 require_root: true, // required by setrlimitForTest()
Ken Chenf2bb7b12022-01-22 19:17:20 +080053 header_libs: ["bpf_connectivity_headers"],
54 srcs: [
55 "BpfNetworkStatsTest.cpp",
56 ],
Ken Chenf426b2b2022-01-23 15:39:13 +080057 cflags: [
58 "-Wall",
59 "-Werror",
60 "-Wno-unused-parameter",
61 "-Wthread-safety",
62 ],
Lorenzo Colitti0db496e2022-02-07 09:01:37 +090063 static_libs: [
64 "libgmock",
65 "libnetworkstats",
66 ],
Ken Chenf2bb7b12022-01-22 19:17:20 +080067 shared_libs: [
68 "libbase",
69 "liblog",
Ken Chenf2bb7b12022-01-22 19:17:20 +080070 ],
71}