blob: 80c68f29e4a5141f641618675058140277828d23 [file] [log] [blame]
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +09001//
2// Copyright (C) 2020 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
Bob Badour727b6722021-02-12 17:07:05 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "frameworks_base_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["frameworks_base_license"],
24}
25
Remi NGUYEN VAN8c2d5212021-03-14 15:28:10 +090026java_library {
27 name: "framework-connectivity-protos",
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +000028 sdk_version: "module_current",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +000029 min_sdk_version: "30",
Remi NGUYEN VAN8c2d5212021-03-14 15:28:10 +090030 proto: {
31 type: "nano",
32 },
33 srcs: [
34 // TODO: consider moving relevant .proto files directly to the module directory
35 ":framework-javastream-protos",
36 ],
37 apex_available: [
38 "//apex_available:platform",
39 "com.android.tethering",
40 ],
41 jarjar_rules: "jarjar-rules-proto.txt",
42 visibility: [
43 "//visibility:private",
44 ],
45}
46
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090047filegroup {
Remi NGUYEN VANad43ca62021-02-15 20:16:28 +090048 name: "framework-connectivity-internal-sources",
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090049 srcs: [
50 "src/**/*.java",
51 "src/**/*.aidl",
52 ],
53 path: "src",
54 visibility: [
Remi NGUYEN VANad43ca62021-02-15 20:16:28 +090055 "//visibility:private",
56 ],
57}
58
59filegroup {
60 name: "framework-connectivity-aidl-export-sources",
61 srcs: [
62 "aidl-export/**/*.aidl",
63 ],
64 path: "aidl-export",
65 visibility: [
66 "//visibility:private",
67 ],
68}
69
70// TODO: use a java_library in the bootclasspath instead
71filegroup {
72 name: "framework-connectivity-sources",
73 srcs: [
74 ":framework-connectivity-internal-sources",
75 ":framework-connectivity-aidl-export-sources",
76 ],
77 visibility: [
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090078 "//frameworks/base",
79 "//packages/modules/Connectivity:__subpackages__",
80 ],
Bob Badour727b6722021-02-12 17:07:05 -080081}
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090082
83java_sdk_library {
84 name: "framework-connectivity",
85 api_only: true,
86 defaults: ["framework-module-defaults"],
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +000087 installable: true,
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090088 srcs: [
89 ":framework-connectivity-sources",
90 ],
91 aidl: {
92 include_dirs: [
93 // Include directories for parcelables that are part of the stable API, and need a
94 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
95 // TODO(b/180293679): remove these dependencies as they should not be necessary once
96 // the module builds against API (the parcelable declarations exist in framework.aidl)
97 "frameworks/base/core/java", // For framework parcelables
98 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
99 ],
100 },
101 libs: [
102 "unsupportedappusage",
103 ],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000104 permitted_packages: ["android.net"],
105}
106
107cc_defaults {
108 name: "libframework-connectivity-defaults",
109 cflags: [
110 "-Wall",
111 "-Werror",
112 "-Wno-unused-parameter",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000113 // Don't warn about S API usage even with
114 // min_sdk 30: the library is only loaded
115 // on S+ devices
116 "-Wno-unguarded-availability",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000117 "-Wthread-safety",
118 ],
119 shared_libs: [
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000120 "liblog",
121 "libnativehelper",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000122 ],
123 header_libs: [
124 "dnsproxyd_protocol_headers",
125 ],
126}
127
128cc_library_static {
129 name: "libconnectivityframeworkutils",
130 defaults: ["libframework-connectivity-defaults"],
131 srcs: [
132 "jni/android_net_NetworkUtils.cpp",
133 ],
Remi NGUYEN VAN31f329e2021-03-21 14:30:38 +0000134 shared_libs: ["libandroid_net"],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000135 apex_available: [
136 "//apex_available:platform",
137 "com.android.tethering",
138 ],
139}
140
141cc_library_shared {
142 name: "libframework-connectivity-jni",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000143 min_sdk_version: "30",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000144 defaults: ["libframework-connectivity-defaults"],
145 srcs: [
Remi NGUYEN VAN6b0c4072021-03-23 10:50:45 +0000146 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000147 "jni/onload.cpp",
148 ],
Remi NGUYEN VAN31f329e2021-03-21 14:30:38 +0000149 shared_libs: ["libandroid"],
Remi NGUYEN VAN47cc6512021-03-24 01:49:39 +0000150 stl: "libc++_static",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000151 apex_available: [
152 "//apex_available:platform",
153 "com.android.tethering",
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +0000154 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +0900155}
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900156
157java_library {
158 name: "framework-connectivity.impl",
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +0000159 sdk_version: "module_current",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000160 min_sdk_version: "30",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900161 srcs: [
162 ":framework-connectivity-sources",
163 ],
164 aidl: {
165 include_dirs: [
166 "frameworks/base/core/java", // For framework parcelables
167 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
168 ],
169 },
170 libs: [
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +0000171 // TODO (b/183097033) remove once module_current includes core_current
172 "stable.core.platform.api.stubs",
173 "framework-tethering",
174 "framework-wifi",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900175 "unsupportedappusage",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900176 ],
177 static_libs: [
Remi NGUYEN VAN8c2d5212021-03-14 15:28:10 +0900178 "framework-connectivity-protos",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900179 "net-utils-device-common",
180 ],
181 jarjar_rules: "jarjar-rules.txt",
182 apex_available: ["com.android.tethering"],
183 installable: true,
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000184 permitted_packages: ["android.net"],
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900185}