blob: 74cecdd351b37891d203bae9a2b7f475f29fd70f [file] [log] [blame]
Remi NGUYEN VANc2fb3492021-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 Badour9d156242021-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 VANd2f03002021-03-14 15:28:10 +090026java_library {
27 name: "framework-connectivity-protos",
Remi NGUYEN VAN2a311db2021-03-19 00:24:45 +000028 sdk_version: "module_current",
Remi NGUYEN VAN4dbc3b52021-03-23 14:45:58 +000029 min_sdk_version: "30",
Remi NGUYEN VANd2f03002021-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: [
Remi NGUYEN VANd2f03002021-03-14 15:28:10 +090038 "com.android.tethering",
39 ],
40 jarjar_rules: "jarjar-rules-proto.txt",
41 visibility: [
42 "//visibility:private",
43 ],
44}
45
Remi NGUYEN VANc2fb3492021-01-15 16:22:36 +090046filegroup {
Remi NGUYEN VAN076dcdc2021-02-15 20:16:28 +090047 name: "framework-connectivity-internal-sources",
Remi NGUYEN VANc2fb3492021-01-15 16:22:36 +090048 srcs: [
49 "src/**/*.java",
50 "src/**/*.aidl",
51 ],
52 path: "src",
53 visibility: [
Remi NGUYEN VAN076dcdc2021-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 VANc2fb3492021-01-15 16:22:36 +090077 "//frameworks/base",
78 "//packages/modules/Connectivity:__subpackages__",
79 ],
Bob Badour9d156242021-02-12 17:07:05 -080080}
Remi NGUYEN VANc1326df2021-01-28 13:37:03 +090081
82java_sdk_library {
83 name: "framework-connectivity",
Remi NGUYEN VAN972aa342021-03-24 22:59:50 +090084 sdk_version: "module_current",
85 min_sdk_version: "30",
Remi NGUYEN VANc1326df2021-01-28 13:37:03 +090086 defaults: ["framework-module-defaults"],
Remi NGUYEN VAN2a311db2021-03-19 00:24:45 +000087 installable: true,
Remi NGUYEN VANc1326df2021-01-28 13:37:03 +090088 srcs: [
89 ":framework-connectivity-sources",
Remi NGUYEN VAN972aa342021-03-24 22:59:50 +090090 ":net-utils-framework-common-srcs",
Remi NGUYEN VANc1326df2021-01-28 13:37:03 +090091 ],
92 aidl: {
93 include_dirs: [
94 // Include directories for parcelables that are part of the stable API, and need a
95 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
96 // TODO(b/180293679): remove these dependencies as they should not be necessary once
97 // the module builds against API (the parcelable declarations exist in framework.aidl)
98 "frameworks/base/core/java", // For framework parcelables
99 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
100 ],
101 },
Remi NGUYEN VAN972aa342021-03-24 22:59:50 +0900102 impl_only_libs: [
103 // TODO (b/183097033) remove once module_current includes core_platform
104 "stable.core.platform.api.stubs",
105 "framework-tethering.stubs.module_lib",
106 "framework-wifi.stubs.module_lib",
107 "net-utils-device-common",
108 ],
Remi NGUYEN VANc1326df2021-01-28 13:37:03 +0900109 libs: [
110 "unsupportedappusage",
111 ],
Remi NGUYEN VAN972aa342021-03-24 22:59:50 +0900112 static_libs: [
113 "framework-connectivity-protos",
114 ],
115 jarjar_rules: "jarjar-rules.txt",
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000116 permitted_packages: ["android.net"],
Remi NGUYEN VAN972aa342021-03-24 22:59:50 +0900117 impl_library_visibility: [
118 "//packages/modules/Connectivity/Tethering/apex",
119 // In preparation for future move
120 "//packages/modules/Connectivity/apex",
121 "//packages/modules/Connectivity/service",
122 "//frameworks/base/packages/Connectivity/service",
123 "//frameworks/base",
124 "//packages/modules/Connectivity/Tethering/tests/unit",
125 ],
126 apex_available: [
Remi NGUYEN VAN972aa342021-03-24 22:59:50 +0900127 "com.android.tethering",
128 ],
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000129}
130
131cc_defaults {
132 name: "libframework-connectivity-defaults",
133 cflags: [
134 "-Wall",
135 "-Werror",
136 "-Wno-unused-parameter",
Remi NGUYEN VAN4dbc3b52021-03-23 14:45:58 +0000137 // Don't warn about S API usage even with
138 // min_sdk 30: the library is only loaded
139 // on S+ devices
140 "-Wno-unguarded-availability",
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000141 "-Wthread-safety",
142 ],
143 shared_libs: [
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000144 "liblog",
145 "libnativehelper",
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000146 ],
147 header_libs: [
148 "dnsproxyd_protocol_headers",
149 ],
150}
151
152cc_library_static {
153 name: "libconnectivityframeworkutils",
154 defaults: ["libframework-connectivity-defaults"],
155 srcs: [
156 "jni/android_net_NetworkUtils.cpp",
157 ],
Remi NGUYEN VAN5aee36b2021-03-21 14:30:38 +0000158 shared_libs: ["libandroid_net"],
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000159 apex_available: [
160 "//apex_available:platform",
161 "com.android.tethering",
162 ],
163}
164
165cc_library_shared {
166 name: "libframework-connectivity-jni",
Remi NGUYEN VAN4dbc3b52021-03-23 14:45:58 +0000167 min_sdk_version: "30",
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000168 defaults: ["libframework-connectivity-defaults"],
169 srcs: [
Remi NGUYEN VAN66304632021-03-23 10:50:45 +0000170 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000171 "jni/onload.cpp",
172 ],
Remi NGUYEN VAN5aee36b2021-03-21 14:30:38 +0000173 shared_libs: ["libandroid"],
Remi NGUYEN VAN35b485e2021-03-24 01:49:39 +0000174 stl: "libc++_static",
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000175 apex_available: [
Remi NGUYEN VAN8f0031d2021-03-19 10:13:40 +0000176 "com.android.tethering",
Remi NGUYEN VAN2a311db2021-03-19 00:24:45 +0000177 ],
Remi NGUYEN VANc1326df2021-01-28 13:37:03 +0900178}