blob: e0bb862c5362e38e7bfc28c3532397f52809ff22 [file] [log] [blame]
Remi NGUYEN VANded23152018-12-07 16:52:24 +09001//
2// Copyright (C) 2018 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
paulhu5982eff2019-03-29 19:21:30 +080017java_library {
18 name: "captiveportal-lib",
19 srcs: ["common/**/*.java"],
20 libs: [
21 "androidx.annotation_annotation",
22 ],
23 sdk_version: "system_current",
24}
25
Remi NGUYEN VAN40369562019-03-20 16:40:54 +090026java_defaults {
27 name: "NetworkStackCommon",
28 sdk_version: "system_current",
29 min_sdk_version: "28",
30}
31
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +090032// Library including the network stack, used to compile both variants of the network stack
33android_library {
34 name: "NetworkStackBase",
Remi NGUYEN VAN40369562019-03-20 16:40:54 +090035 defaults: ["NetworkStackCommon"],
Remi NGUYEN VANded23152018-12-07 16:52:24 +090036 srcs: [
37 "src/**/*.java",
Remi NGUYEN VAN82b4b422019-01-20 09:35:10 +090038 ":framework-networkstack-shared-srcs",
Remi NGUYEN VAN5daa3702018-12-27 16:43:56 +090039 ":services-networkstack-shared-srcs",
Chiachang Wang53817ca2019-04-11 21:24:28 +080040 ":statslog-networkstack-java-gen",
Remi NGUYEN VANded23152018-12-07 16:52:24 +090041 ],
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +090042 static_libs: [
Remi NGUYEN VAN9babdec2019-04-09 02:04:54 -070043 "androidx.annotation_annotation",
Chalard Jean5b678762019-01-30 21:04:58 +090044 "ipmemorystore-client",
Remi NGUYEN VAN6e9fdbd2019-01-29 15:38:52 +090045 "netd_aidl_interface-java",
46 "networkstack-aidl-interfaces-java",
Chiachang Wang8b5f84a2019-02-22 11:13:07 +080047 "datastallprotosnano",
Chiachang Wang54663a82019-03-21 20:40:01 +080048 "networkstackprotosnano",
paulhu5982eff2019-03-29 19:21:30 +080049 "captiveportal-lib",
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +090050 ],
51 manifest: "AndroidManifestBase.xml",
52}
53
Remi NGUYEN VANf38a5642019-04-05 04:44:45 -070054cc_library_shared {
55 name: "libnetworkstackutilsjni",
56 srcs: [
57 "jni/network_stack_utils_jni.cpp"
58 ],
59
60 shared_libs: [
61 "liblog",
62 "libcutils",
63 "libnativehelper",
64 ],
65 static_libs: [
66 "libpcap",
67 ],
68 cflags: [
69 "-Wall",
70 "-Werror",
71 "-Wno-unused-parameter",
72 ],
73}
74
Remi NGUYEN VAN40369562019-03-20 16:40:54 +090075java_defaults {
76 name: "NetworkStackAppCommon",
77 defaults: ["NetworkStackCommon"],
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +090078 privileged: true,
79 static_libs: [
80 "NetworkStackBase",
81 ],
Remi NGUYEN VANf38a5642019-04-05 04:44:45 -070082 jni_libs: ["libnetworkstackutilsjni"],
Remi NGUYEN VAN40369562019-03-20 16:40:54 +090083 // Resources already included in NetworkStackBase
84 resource_dirs: [],
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +090085 jarjar_rules: "jarjar-rules-shared.txt",
Remi NGUYEN VAN776d7f72019-03-26 14:58:08 +090086 optimize: {
87 proguard_flags_files: ["proguard.flags"],
88 },
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +090089 // The permission configuration *must* be included to ensure security of the device
Remi NGUYEN VAN288fb702019-03-26 17:24:48 +090090 required: ["NetworkPermissionConfig"],
Remi NGUYEN VAN40369562019-03-20 16:40:54 +090091}
92
93// Non-updatable network stack running in the system server process for devices not using the module
94android_app {
95 name: "InProcessNetworkStack",
96 defaults: ["NetworkStackAppCommon"],
97 certificate: "platform",
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +090098 manifest: "AndroidManifest_InProcess.xml",
Remi NGUYEN VANded23152018-12-07 16:52:24 +090099}
100
101// Updatable network stack packaged as an application
102android_app {
103 name: "NetworkStack",
Remi NGUYEN VAN40369562019-03-20 16:40:54 +0900104 defaults: ["NetworkStackAppCommon"],
Remi NGUYEN VANd8327a22019-02-15 17:45:03 +0900105 certificate: "networkstack",
Remi NGUYEN VAN0a4df5a2019-03-08 17:20:49 +0900106 manifest: "AndroidManifest.xml",
Chiachang Wang8b5f84a2019-02-22 11:13:07 +0800107}
Chiachang Wang53817ca2019-04-11 21:24:28 +0800108
109genrule {
110 name: "statslog-networkstack-java-gen",
111 tools: ["stats-log-api-gen"],
112 cmd: "$(location stats-log-api-gen) --java $(out) --module network_stack" +
113 " --javaPackage com.android.networkstack.metrics --javaClass NetworkStackStatsLog",
114 out: ["com/android/networkstack/metrics/NetworkStackStatsLog.java"],
115}