blob: a969c835d639133df7cf45cca8428dedbd380d20 [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 VAN326f7bb2021-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",
81 api_only: true,
82 defaults: ["framework-module-defaults"],
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +000083 installable: true,
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090084 srcs: [
85 ":framework-connectivity-sources",
86 ],
87 aidl: {
88 include_dirs: [
89 // Include directories for parcelables that are part of the stable API, and need a
90 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
91 // TODO(b/180293679): remove these dependencies as they should not be necessary once
92 // the module builds against API (the parcelable declarations exist in framework.aidl)
93 "frameworks/base/core/java", // For framework parcelables
94 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
95 ],
96 },
97 libs: [
98 "unsupportedappusage",
99 ],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000100 permitted_packages: ["android.net"],
101}
102
103cc_defaults {
104 name: "libframework-connectivity-defaults",
105 cflags: [
106 "-Wall",
107 "-Werror",
108 "-Wno-unused-parameter",
Remi NGUYEN VAN326f7bb2021-03-23 14:45:58 +0000109 // Don't warn about S API usage even with
110 // min_sdk 30: the library is only loaded
111 // on S+ devices
112 "-Wno-unguarded-availability",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000113 "-Wthread-safety",
114 ],
115 shared_libs: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000116 "liblog",
117 "libnativehelper",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000118 ],
119 header_libs: [
120 "dnsproxyd_protocol_headers",
121 ],
122}
123
124cc_library_static {
125 name: "libconnectivityframeworkutils",
126 defaults: ["libframework-connectivity-defaults"],
127 srcs: [
128 "jni/android_net_NetworkUtils.cpp",
129 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000130 shared_libs: ["libandroid_net"],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000131 apex_available: [
132 "//apex_available:platform",
133 "com.android.tethering",
134 ],
135}
136
137cc_library_shared {
138 name: "libframework-connectivity-jni",
Remi NGUYEN VAN326f7bb2021-03-23 14:45:58 +0000139 min_sdk_version: "30",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000140 defaults: ["libframework-connectivity-defaults"],
141 srcs: [
Remi NGUYEN VAN8d1a96d2021-03-23 10:50:45 +0000142 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000143 "jni/onload.cpp",
144 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000145 shared_libs: ["libandroid"],
Remi NGUYEN VAN4be92df2021-03-24 01:49:39 +0000146 stl: "libc++_static",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000147 apex_available: [
148 "//apex_available:platform",
149 "com.android.tethering",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000150 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900151}
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900152
153java_library {
154 name: "framework-connectivity.impl",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000155 sdk_version: "module_current",
Remi NGUYEN VAN326f7bb2021-03-23 14:45:58 +0000156 min_sdk_version: "30",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900157 srcs: [
158 ":framework-connectivity-sources",
159 ],
160 aidl: {
161 include_dirs: [
162 "frameworks/base/core/java", // For framework parcelables
163 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
164 ],
165 },
166 libs: [
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000167 // TODO (b/183097033) remove once module_current includes core_current
168 "stable.core.platform.api.stubs",
169 "framework-tethering",
170 "framework-wifi",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900171 "unsupportedappusage",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900172 ],
173 static_libs: [
Remi NGUYEN VANf96b2662021-03-14 15:28:10 +0900174 "framework-connectivity-protos",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900175 "net-utils-device-common",
176 ],
177 jarjar_rules: "jarjar-rules.txt",
178 apex_available: ["com.android.tethering"],
179 installable: true,
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000180 permitted_packages: ["android.net"],
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900181}