blob: 185e8a5a0e2fa3a220d2acdbb8961d689ed73701 [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: [
100 // TODO (b/183097033) remove once module_current includes core_platform
101 "stable.core.platform.api.stubs",
102 "framework-tethering.stubs.module_lib",
103 "framework-wifi.stubs.module_lib",
104 "net-utils-device-common",
105 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900106 libs: [
107 "unsupportedappusage",
108 ],
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900109 static_libs: [
110 "framework-connectivity-protos",
111 ],
112 jarjar_rules: "jarjar-rules.txt",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000113 permitted_packages: ["android.net"],
Remi NGUYEN VANe70cd842021-03-24 22:59:50 +0900114 impl_library_visibility: [
115 "//packages/modules/Connectivity/Tethering/apex",
116 // In preparation for future move
117 "//packages/modules/Connectivity/apex",
118 "//packages/modules/Connectivity/service",
119 "//frameworks/base/packages/Connectivity/service",
120 "//frameworks/base",
121 "//packages/modules/Connectivity/Tethering/tests/unit",
122 ],
123 apex_available: [
124 "//apex_available:platform",
125 "com.android.tethering",
126 ],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000127}
128
129cc_defaults {
130 name: "libframework-connectivity-defaults",
131 cflags: [
132 "-Wall",
133 "-Werror",
134 "-Wno-unused-parameter",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000135 // Don't warn about S API usage even with
136 // min_sdk 30: the library is only loaded
137 // on S+ devices
138 "-Wno-unguarded-availability",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000139 "-Wthread-safety",
140 ],
141 shared_libs: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000142 "liblog",
143 "libnativehelper",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000144 ],
145 header_libs: [
146 "dnsproxyd_protocol_headers",
147 ],
148}
149
150cc_library_static {
151 name: "libconnectivityframeworkutils",
152 defaults: ["libframework-connectivity-defaults"],
153 srcs: [
154 "jni/android_net_NetworkUtils.cpp",
155 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000156 shared_libs: ["libandroid_net"],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000157 apex_available: [
158 "//apex_available:platform",
159 "com.android.tethering",
160 ],
161}
162
163cc_library_shared {
164 name: "libframework-connectivity-jni",
Remi NGUYEN VANda43ef02021-03-23 14:45:58 +0000165 min_sdk_version: "30",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000166 defaults: ["libframework-connectivity-defaults"],
167 srcs: [
Remi NGUYEN VAN8d1a96d2021-03-23 10:50:45 +0000168 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000169 "jni/onload.cpp",
170 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000171 shared_libs: ["libandroid"],
Remi NGUYEN VAN4be92df2021-03-24 01:49:39 +0000172 stl: "libc++_static",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000173 apex_available: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000174 "com.android.tethering",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000175 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900176}