blob: 93ef3bf4ed315cf14462e78c145065d92f647f4c [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 Badour6c7ed9d2021-02-12 17:07:05 -080017package {
18 // See: http://go/android-license-faq
Baligh Uddin36847132021-05-23 16:38:40 +000019 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour6c7ed9d2021-02-12 17:07:05 -080020}
21
Remi NGUYEN VANf96b2662021-03-14 15:28:10 +090022java_library {
23 name: "framework-connectivity-protos",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +000024 sdk_version: "module_current",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +000025 min_sdk_version: "30",
Remi NGUYEN VANf96b2662021-03-14 15:28:10 +090026 proto: {
27 type: "nano",
28 },
29 srcs: [
30 // TODO: consider moving relevant .proto files directly to the module directory
31 ":framework-javastream-protos",
32 ],
33 apex_available: [
34 "//apex_available:platform",
35 "com.android.tethering",
36 ],
37 jarjar_rules: "jarjar-rules-proto.txt",
38 visibility: [
39 "//visibility:private",
40 ],
41}
42
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090043filegroup {
Remi NGUYEN VAN6916d512021-02-15 20:16:28 +090044 name: "framework-connectivity-internal-sources",
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090045 srcs: [
46 "src/**/*.java",
47 "src/**/*.aidl",
48 ],
49 path: "src",
50 visibility: [
Remi NGUYEN VAN6916d512021-02-15 20:16:28 +090051 "//visibility:private",
52 ],
53}
54
55filegroup {
56 name: "framework-connectivity-aidl-export-sources",
57 srcs: [
58 "aidl-export/**/*.aidl",
59 ],
60 path: "aidl-export",
61 visibility: [
62 "//visibility:private",
63 ],
64}
65
66// TODO: use a java_library in the bootclasspath instead
67filegroup {
68 name: "framework-connectivity-sources",
69 srcs: [
70 ":framework-connectivity-internal-sources",
71 ":framework-connectivity-aidl-export-sources",
72 ],
73 visibility: [
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090074 "//frameworks/base",
75 "//packages/modules/Connectivity:__subpackages__",
76 ],
Bob Badour6c7ed9d2021-02-12 17:07:05 -080077}
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090078
79java_sdk_library {
80 name: "framework-connectivity",
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +090081 sdk_version: "module_current",
82 min_sdk_version: "30",
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090083 defaults: ["framework-module-defaults"],
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +000084 installable: true,
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090085 srcs: [
86 ":framework-connectivity-sources",
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +090087 ":net-utils-framework-common-srcs",
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090088 ],
89 aidl: {
90 include_dirs: [
91 // Include directories for parcelables that are part of the stable API, and need a
92 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
93 // TODO(b/180293679): remove these dependencies as they should not be necessary once
94 // the module builds against API (the parcelable declarations exist in framework.aidl)
95 "frameworks/base/core/java", // For framework parcelables
96 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
97 ],
98 },
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +090099 impl_only_libs: [
100 // TODO (b/183097033) remove once module_current includes core_platform
101 "stable.core.platform.api.stubs",
102 "framework-tethering.stubs.module_lib",
103 "framework-wifi.stubs.module_lib",
104 "net-utils-device-common",
105 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900106 libs: [
107 "unsupportedappusage",
108 ],
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900109 static_libs: [
110 "framework-connectivity-protos",
111 ],
112 jarjar_rules: "jarjar-rules.txt",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000113 permitted_packages: ["android.net"],
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900114 impl_library_visibility: [
115 "//packages/modules/Connectivity/Tethering/apex",
116 // In preparation for future move
117 "//packages/modules/Connectivity/apex",
118 "//packages/modules/Connectivity/service",
119 "//frameworks/base/packages/Connectivity/service",
120 "//frameworks/base",
Remi NGUYEN VAN3912c802021-03-16 01:31:07 +0000121
122 // Tests using hidden APIs
123 "//external/sl4a:__subpackages__",
124 "//frameworks/base/tests/net:__subpackages__",
125 "//frameworks/libs/net/common/testutils",
126 "//frameworks/libs/net/common/tests:__subpackages__",
127 "//frameworks/opt/telephony/tests/telephonytests",
128 "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
129 "//packages/modules/Connectivity/tests:__subpackages__",
130 "//packages/modules/NetworkStack/tests:__subpackages__",
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900131 ],
132 apex_available: [
133 "//apex_available:platform",
134 "com.android.tethering",
135 ],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000136}
137
138cc_defaults {
139 name: "libframework-connectivity-defaults",
140 cflags: [
141 "-Wall",
142 "-Werror",
143 "-Wno-unused-parameter",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000144 // Don't warn about S API usage even with
145 // min_sdk 30: the library is only loaded
146 // on S+ devices
147 "-Wno-unguarded-availability",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000148 "-Wthread-safety",
149 ],
150 shared_libs: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000151 "liblog",
152 "libnativehelper",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000153 ],
154 header_libs: [
155 "dnsproxyd_protocol_headers",
156 ],
157}
158
159cc_library_static {
160 name: "libconnectivityframeworkutils",
161 defaults: ["libframework-connectivity-defaults"],
162 srcs: [
163 "jni/android_net_NetworkUtils.cpp",
164 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000165 shared_libs: ["libandroid_net"],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000166 apex_available: [
167 "//apex_available:platform",
168 "com.android.tethering",
169 ],
170}
171
172cc_library_shared {
173 name: "libframework-connectivity-jni",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000174 min_sdk_version: "30",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000175 defaults: ["libframework-connectivity-defaults"],
176 srcs: [
Remi NGUYEN VAN8d1a96d2021-03-23 10:50:45 +0000177 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000178 "jni/onload.cpp",
179 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000180 shared_libs: ["libandroid"],
Remi NGUYEN VAN4be92df2021-03-24 01:49:39 +0000181 stl: "libc++_static",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000182 apex_available: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000183 "com.android.tethering",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000184 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900185}