blob: 4fa9ccbc0228bd33597bedc8a1302b3b77465d71 [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 VANf96b2662021-03-14 15:28:10 +090025 proto: {
26 type: "nano",
27 },
28 srcs: [
29 // TODO: consider moving relevant .proto files directly to the module directory
30 ":framework-javastream-protos",
31 ],
32 apex_available: [
33 "//apex_available:platform",
34 "com.android.tethering",
35 ],
36 jarjar_rules: "jarjar-rules-proto.txt",
37 visibility: [
38 "//visibility:private",
39 ],
40}
41
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090042filegroup {
Remi NGUYEN VAN6916d512021-02-15 20:16:28 +090043 name: "framework-connectivity-internal-sources",
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090044 srcs: [
45 "src/**/*.java",
46 "src/**/*.aidl",
47 ],
48 path: "src",
49 visibility: [
Remi NGUYEN VAN6916d512021-02-15 20:16:28 +090050 "//visibility:private",
51 ],
52}
53
54filegroup {
55 name: "framework-connectivity-aidl-export-sources",
56 srcs: [
57 "aidl-export/**/*.aidl",
58 ],
59 path: "aidl-export",
60 visibility: [
61 "//visibility:private",
62 ],
63}
64
65// TODO: use a java_library in the bootclasspath instead
66filegroup {
67 name: "framework-connectivity-sources",
68 srcs: [
69 ":framework-connectivity-internal-sources",
70 ":framework-connectivity-aidl-export-sources",
71 ],
72 visibility: [
Remi NGUYEN VAN66ea68e2021-01-15 16:22:36 +090073 "//frameworks/base",
74 "//packages/modules/Connectivity:__subpackages__",
75 ],
Bob Badour6c7ed9d2021-02-12 17:07:05 -080076}
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090077
78java_sdk_library {
79 name: "framework-connectivity",
80 api_only: true,
81 defaults: ["framework-module-defaults"],
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +000082 installable: true,
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090083 srcs: [
84 ":framework-connectivity-sources",
85 ],
86 aidl: {
87 include_dirs: [
88 // Include directories for parcelables that are part of the stable API, and need a
89 // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces.
90 // TODO(b/180293679): remove these dependencies as they should not be necessary once
91 // the module builds against API (the parcelable declarations exist in framework.aidl)
92 "frameworks/base/core/java", // For framework parcelables
93 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
94 ],
95 },
96 libs: [
97 "unsupportedappusage",
98 ],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +000099 permitted_packages: ["android.net"],
100}
101
102cc_defaults {
103 name: "libframework-connectivity-defaults",
104 cflags: [
105 "-Wall",
106 "-Werror",
107 "-Wno-unused-parameter",
108 "-Wthread-safety",
109 ],
110 shared_libs: [
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000111 "liblog",
112 "libnativehelper",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000113 ],
114 header_libs: [
115 "dnsproxyd_protocol_headers",
116 ],
117}
118
119cc_library_static {
120 name: "libconnectivityframeworkutils",
121 defaults: ["libframework-connectivity-defaults"],
122 srcs: [
123 "jni/android_net_NetworkUtils.cpp",
124 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000125 shared_libs: ["libandroid_net"],
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000126 apex_available: [
127 "//apex_available:platform",
128 "com.android.tethering",
129 ],
130}
131
132cc_library_shared {
133 name: "libframework-connectivity-jni",
134 defaults: ["libframework-connectivity-defaults"],
135 srcs: [
Remi NGUYEN VAN8d1a96d2021-03-23 10:50:45 +0000136 "jni/android_net_NetworkUtils.cpp",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000137 "jni/onload.cpp",
138 ],
Remi NGUYEN VANa5e11482021-03-21 14:30:38 +0000139 shared_libs: ["libandroid"],
Remi NGUYEN VAN4be92df2021-03-24 01:49:39 +0000140 stl: "libc++_static",
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000141 apex_available: [
142 "//apex_available:platform",
143 "com.android.tethering",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000144 ],
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900145}
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900146
147java_library {
148 name: "framework-connectivity.impl",
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000149 sdk_version: "module_current",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900150 srcs: [
151 ":framework-connectivity-sources",
152 ],
153 aidl: {
154 include_dirs: [
155 "frameworks/base/core/java", // For framework parcelables
156 "frameworks/native/aidl/binder", // For PersistableBundle.aidl
157 ],
158 },
159 libs: [
Remi NGUYEN VANe4d51c92021-03-19 00:24:45 +0000160 // TODO (b/183097033) remove once module_current includes core_current
161 "stable.core.platform.api.stubs",
162 "framework-tethering",
163 "framework-wifi",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900164 "unsupportedappusage",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900165 ],
166 static_libs: [
Remi NGUYEN VANf96b2662021-03-14 15:28:10 +0900167 "framework-connectivity-protos",
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900168 "net-utils-device-common",
169 ],
170 jarjar_rules: "jarjar-rules.txt",
171 apex_available: ["com.android.tethering"],
172 installable: true,
Remi NGUYEN VAN1fd558e2021-03-19 10:13:40 +0000173 permitted_packages: ["android.net"],
Remi NGUYEN VANeb6aa222021-03-14 12:56:26 +0900174}