blob: ee3a5d58de4e31335eb491099dd5a0e1d8d4dbb3 [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: [
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900100 "framework-tethering.stubs.module_lib",
101 "framework-wifi.stubs.module_lib",
102 "net-utils-device-common",
103 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900104 libs: [
105 "unsupportedappusage",
106 ],
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900107 static_libs: [
108 "framework-connectivity-protos",
109 ],
110 jarjar_rules: "jarjar-rules.txt",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000111 permitted_packages: ["android.net"],
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900112 impl_library_visibility: [
113 "//packages/modules/Connectivity/Tethering/apex",
114 // In preparation for future move
115 "//packages/modules/Connectivity/apex",
116 "//packages/modules/Connectivity/service",
117 "//frameworks/base/packages/Connectivity/service",
118 "//frameworks/base",
Remi NGUYEN VAN3912c802021-03-16 01:31:07 +0000119
120 // Tests using hidden APIs
121 "//external/sl4a:__subpackages__",
122 "//frameworks/base/tests/net:__subpackages__",
123 "//frameworks/libs/net/common/testutils",
124 "//frameworks/libs/net/common/tests:__subpackages__",
125 "//frameworks/opt/telephony/tests/telephonytests",
126 "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
127 "//packages/modules/Connectivity/tests:__subpackages__",
128 "//packages/modules/NetworkStack/tests:__subpackages__",
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900129 ],
130 apex_available: [
131 "//apex_available:platform",
132 "com.android.tethering",
133 ],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000134}
135
136cc_defaults {
137 name: "libframework-connectivity-defaults",
138 cflags: [
139 "-Wall",
140 "-Werror",
141 "-Wno-unused-parameter",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000142 // Don't warn about S API usage even with
143 // min_sdk 30: the library is only loaded
144 // on S+ devices
145 "-Wno-unguarded-availability",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000146 "-Wthread-safety",
147 ],
148 shared_libs: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000149 "liblog",
150 "libnativehelper",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000151 ],
152 header_libs: [
153 "dnsproxyd_protocol_headers",
154 ],
155}
156
157cc_library_static {
158 name: "libconnectivityframeworkutils",
159 defaults: ["libframework-connectivity-defaults"],
160 srcs: [
161 "jni/android_net_NetworkUtils.cpp",
162 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000163 shared_libs: ["libandroid_net"],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000164 apex_available: [
165 "//apex_available:platform",
166 "com.android.tethering",
167 ],
168}
169
170cc_library_shared {
171 name: "libframework-connectivity-jni",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000172 min_sdk_version: "30",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000173 defaults: ["libframework-connectivity-defaults"],
174 srcs: [
Remi NGUYEN VAN8d1a96d2021-03-23 10:50:45 +0000175 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000176 "jni/onload.cpp",
177 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000178 shared_libs: ["libandroid"],
Remi NGUYEN VAN4be92df2021-03-24 01:49:39 +0000179 stl: "libc++_static",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000180 apex_available: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000181 "com.android.tethering",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000182 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900183}