blob: 657d5a3d2eae761b159b7e72534aa8eee5c0670d [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
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 VANf96b2662021-03-14 15:28:10 +090026java_library {
27 name: "framework-connectivity-protos",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +000028 sdk_version: "module_current",
Remi NGUYEN VANf96b2662021-03-14 15:28:10 +090029 proto: {
30 type: "nano",
31 },
32 srcs: [
33 // TODO: consider moving relevant .proto files directly to the module directory
34 ":framework-javastream-protos",
35 ],
36 apex_available: [
37 "//apex_available:platform",
38 "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 VAN6916d512021-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 VAN6916d512021-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 Badour6c7ed9d2021-02-12 17:07:05 -080080}
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090081
82java_sdk_library {
83 name: "framework-connectivity",
84 api_only: true,
85 defaults: ["framework-module-defaults"],
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +000086 installable: true,
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090087 srcs: [
88 ":framework-connectivity-sources",
89 ],
90 aidl: {
91 include_dirs: [
92 // Include directories for parcelables that are part of the stable API, and need a
93 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
94 // TODO(b/180293679): remove these dependencies as they should not be necessary once
95 // the module builds against API (the parcelable declarations exist in framework.aidl)
96 "frameworks/base/core/java", // For framework parcelables
97 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
98 ],
99 },
100 libs: [
101 "unsupportedappusage",
102 ],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000103 permitted_packages: ["android.net"],
104}
105
106cc_defaults {
107 name: "libframework-connectivity-defaults",
108 cflags: [
109 "-Wall",
110 "-Werror",
111 "-Wno-unused-parameter",
112 "-Wthread-safety",
113 ],
114 shared_libs: [
115 "libbase",
116 "liblog",
117 "libnativehelper",
118 "libnetd_client",
119 ],
120 header_libs: [
121 "dnsproxyd_protocol_headers",
122 ],
123}
124
125cc_library_static {
126 name: "libconnectivityframeworkutils",
127 defaults: ["libframework-connectivity-defaults"],
128 srcs: [
129 "jni/android_net_NetworkUtils.cpp",
130 ],
131 apex_available: [
132 "//apex_available:platform",
133 "com.android.tethering",
134 ],
135}
136
137cc_library_shared {
138 name: "libframework-connectivity-jni",
139 defaults: ["libframework-connectivity-defaults"],
140 srcs: [
141 "jni/onload.cpp",
142 ],
143 static_libs: ["libconnectivityframeworkutils"],
144 apex_available: [
145 "//apex_available:platform",
146 "com.android.tethering",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000147 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900148}
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900149
150java_library {
151 name: "framework-connectivity.impl",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000152 sdk_version: "module_current",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900153 srcs: [
154 ":framework-connectivity-sources",
155 ],
156 aidl: {
157 include_dirs: [
158 "frameworks/base/core/java", // For framework parcelables
159 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
160 ],
161 },
162 libs: [
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000163 // TODO (b/183097033) remove once module_current includes core_current
164 "stable.core.platform.api.stubs",
165 "framework-tethering",
166 "framework-wifi",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900167 "unsupportedappusage",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900168 ],
169 static_libs: [
Remi NGUYEN VANf96b2662021-03-14 15:28:10 +0900170 "framework-connectivity-protos",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900171 "net-utils-device-common",
172 ],
173 jarjar_rules: "jarjar-rules.txt",
174 apex_available: ["com.android.tethering"],
175 installable: true,
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000176 permitted_packages: ["android.net"],
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900177}