blob: fdfb1086de0b7acbeb31455745afabefdd4659d9 [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",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090085 sdk_version: "module_current",
86 min_sdk_version: "30",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090087 defaults: ["framework-module-defaults"],
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +000088 installable: true,
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090089 srcs: [
90 ":framework-connectivity-sources",
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +090091 ":net-utils-framework-common-srcs",
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +090092 ],
93 aidl: {
94 include_dirs: [
95 // Include directories for parcelables that are part of the stable API, and need a
96 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
97 // TODO(b/180293679): remove these dependencies as they should not be necessary once
98 // the module builds against API (the parcelable declarations exist in framework.aidl)
99 "frameworks/base/core/java", // For framework parcelables
100 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
101 ],
102 },
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900103 impl_only_libs: [
104 // TODO (b/183097033) remove once module_current includes core_platform
105 "stable.core.platform.api.stubs",
106 "framework-tethering.stubs.module_lib",
107 "framework-wifi.stubs.module_lib",
108 "net-utils-device-common",
109 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +0900110 libs: [
111 "unsupportedappusage",
112 ],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900113 static_libs: [
114 "framework-connectivity-protos",
115 ],
116 jarjar_rules: "jarjar-rules.txt",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000117 permitted_packages: ["android.net"],
Remi NGUYEN VAN71d64e72021-03-24 22:59:50 +0900118 impl_library_visibility: [
119 "//packages/modules/Connectivity/Tethering/apex",
120 // In preparation for future move
121 "//packages/modules/Connectivity/apex",
122 "//packages/modules/Connectivity/service",
123 "//frameworks/base/packages/Connectivity/service",
124 "//frameworks/base",
125 "//packages/modules/Connectivity/Tethering/tests/unit",
126 ],
127 apex_available: [
128 "//apex_available:platform",
129 "com.android.tethering",
130 ],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000131}
132
133cc_defaults {
134 name: "libframework-connectivity-defaults",
135 cflags: [
136 "-Wall",
137 "-Werror",
138 "-Wno-unused-parameter",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000139 // Don't warn about S API usage even with
140 // min_sdk 30: the library is only loaded
141 // on S+ devices
142 "-Wno-unguarded-availability",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000143 "-Wthread-safety",
144 ],
145 shared_libs: [
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000146 "liblog",
147 "libnativehelper",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000148 ],
149 header_libs: [
150 "dnsproxyd_protocol_headers",
151 ],
152}
153
154cc_library_static {
155 name: "libconnectivityframeworkutils",
156 defaults: ["libframework-connectivity-defaults"],
157 srcs: [
158 "jni/android_net_NetworkUtils.cpp",
159 ],
Remi NGUYEN VAN31f329e2021-03-21 14:30:38 +0000160 shared_libs: ["libandroid_net"],
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000161 apex_available: [
162 "//apex_available:platform",
163 "com.android.tethering",
164 ],
165}
166
167cc_library_shared {
168 name: "libframework-connectivity-jni",
Remi NGUYEN VANb36fb992021-03-23 14:45:58 +0000169 min_sdk_version: "30",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000170 defaults: ["libframework-connectivity-defaults"],
171 srcs: [
Remi NGUYEN VAN6b0c4072021-03-23 10:50:45 +0000172 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000173 "jni/onload.cpp",
174 ],
Remi NGUYEN VAN31f329e2021-03-21 14:30:38 +0000175 shared_libs: ["libandroid"],
Remi NGUYEN VAN47cc6512021-03-24 01:49:39 +0000176 stl: "libc++_static",
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000177 apex_available: [
Remi NGUYEN VANc58c9932021-03-19 10:13:40 +0000178 "com.android.tethering",
Remi NGUYEN VAN3b52af92021-03-19 00:24:45 +0000179 ],
Remi NGUYEN VAN11b5a5c2021-01-28 13:37:03 +0900180}