blob: 90b8d03e174409544af29df51d973a00c2d4c69f [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: [
Remi NGUYEN VAN8c2d5212021-03-14 15:28:10 +090038 "com.android.tethering",
39 ],
40 jarjar_rules: "jarjar-rules-proto.txt",
41 visibility: [
42 "//visibility:private",
43 ],
44}
45
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090046filegroup {
Remi NGUYEN VANad43ca62021-02-15 20:16:28 +090047 name: "framework-connectivity-internal-sources",
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090048 srcs: [
49 "src/**/*.java",
50 "src/**/*.aidl",
51 ],
52 path: "src",
53 visibility: [
Remi NGUYEN VANad43ca62021-02-15 20:16:28 +090054 "//visibility:private",
55 ],
56}
57
58filegroup {
59 name: "framework-connectivity-aidl-export-sources",
60 srcs: [
61 "aidl-export/**/*.aidl",
62 ],
63 path: "aidl-export",
64 visibility: [
65 "//visibility:private",
66 ],
67}
68
69// TODO: use a java_library in the bootclasspath instead
70filegroup {
71 name: "framework-connectivity-sources",
72 srcs: [
73 ":framework-connectivity-internal-sources",
74 ":framework-connectivity-aidl-export-sources",
75 ],
76 visibility: [
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090077 "//frameworks/base",
78 "//packages/modules/Connectivity:__subpackages__",
79 ],
Bob Badour727b6722021-02-12 17:07:05 -080080}
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090081
82java_sdk_library {
83 name: "framework-connectivity",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090084 sdk_version: "module_current",
85 min_sdk_version: "30",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090086 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",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090090 ":net-utils-framework-common-srcs",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090091 ],
92 aidl: {
93 include_dirs: [
94 // Include directories for parcelables that are part of the stable API, and need a
95 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
96 // TODO(b/180293679): remove these dependencies as they should not be necessary once
97 // the module builds against API (the parcelable declarations exist in framework.aidl)
98 "frameworks/base/core/java", // For framework parcelables
99 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
100 ],
101 },
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900102 impl_only_libs: [
103 // TODO (b/183097033) remove once module_current includes core_platform
104 "stable.core.platform.api.stubs",
105 "framework-tethering.stubs.module_lib",
106 "framework-wifi.stubs.module_lib",
107 "net-utils-device-common",
108 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +0900109 libs: [
110 "unsupportedappusage",
111 ],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900112 static_libs: [
113 "framework-connectivity-protos",
114 ],
115 jarjar_rules: "jarjar-rules.txt",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000116 permitted_packages: ["android.net"],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900117 impl_library_visibility: [
118 "//packages/modules/Connectivity/Tethering/apex",
119 // In preparation for future move
120 "//packages/modules/Connectivity/apex",
121 "//packages/modules/Connectivity/service",
122 "//frameworks/base/packages/Connectivity/service",
123 "//frameworks/base",
Remi NGUYEN VAN173f8b12021-03-16 01:31:07 +0000124
125 // Tests using hidden APIs
126 "//external/sl4a:__subpackages__",
127 "//frameworks/base/tests/net:__subpackages__",
128 "//frameworks/libs/net/common/testutils",
129 "//frameworks/libs/net/common/tests:__subpackages__",
130 "//frameworks/opt/telephony/tests/telephonytests",
131 "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
132 "//packages/modules/Connectivity/tests:__subpackages__",
133 "//packages/modules/NetworkStack/tests:__subpackages__",
Chiachang Wange9d848e2021-03-31 16:11:37 +0800134 "//packages/modules/Wifi/service/tests/wifitests",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900135 ],
136 apex_available: [
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900137 "com.android.tethering",
138 ],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000139}
140
141cc_defaults {
142 name: "libframework-connectivity-defaults",
143 cflags: [
144 "-Wall",
145 "-Werror",
146 "-Wno-unused-parameter",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000147 // Don't warn about S API usage even with
148 // min_sdk 30: the library is only loaded
149 // on S+ devices
150 "-Wno-unguarded-availability",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000151 "-Wthread-safety",
152 ],
153 shared_libs: [
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000154 "liblog",
155 "libnativehelper",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000156 ],
157 header_libs: [
158 "dnsproxyd_protocol_headers",
159 ],
160}
161
162cc_library_static {
163 name: "libconnectivityframeworkutils",
164 defaults: ["libframework-connectivity-defaults"],
165 srcs: [
166 "jni/android_net_NetworkUtils.cpp",
167 ],
Remi NGUYEN VAN31f329e2021-03-21 14:30:38 +0000168 shared_libs: ["libandroid_net"],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000169 apex_available: [
170 "//apex_available:platform",
171 "com.android.tethering",
172 ],
173}
174
175cc_library_shared {
176 name: "libframework-connectivity-jni",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000177 min_sdk_version: "30",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000178 defaults: ["libframework-connectivity-defaults"],
179 srcs: [
Remi NGUYEN VAN6b0c4072021-03-23 10:50:45 +0000180 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000181 "jni/onload.cpp",
182 ],
Remi NGUYEN VAN31f329e2021-03-21 14:30:38 +0000183 shared_libs: ["libandroid"],
Remi NGUYEN VAN47cc6512021-03-24 01:49:39 +0000184 stl: "libc++_static",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000185 apex_available: [
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000186 "com.android.tethering",
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +0000187 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +0900188}