blob: cd51f5f90c3466c2d8d56f226a0ff30ece79c09e [file] [log] [blame]
markchien932da862019-08-27 10:19:38 +08001//
2// Copyright (C) 2019 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
17java_defaults {
18 name: "TetheringAndroidLibraryDefaults",
19 platform_apis: true,
20 srcs: [
21 "src/**/*.java",
markchien43e97e02019-09-03 15:58:06 +080022 ":framework-tethering-shared-srcs",
Remi NGUYEN VAN88998f42019-08-09 15:52:06 +090023 ":net-module-utils-srcs",
markchien43e97e02019-09-03 15:58:06 +080024 ":services-tethering-shared-srcs",
markchiendd6177b2019-09-23 20:29:54 +080025 ":servicescore-tethering-src",
markchien932da862019-08-27 10:19:38 +080026 ],
27 static_libs: [
28 "androidx.annotation_annotation",
markchien74a4fa92019-09-09 20:50:49 +080029 "netd_aidl_interface-java",
Remi NGUYEN VAN88998f42019-08-09 15:52:06 +090030 "netlink-client",
markchien74a4fa92019-09-09 20:50:49 +080031 "networkstack-aidl-interfaces-java",
markchien6aa38892019-09-25 14:33:39 +080032 "android.hardware.tetheroffload.control-V1.0-java",
markchien932da862019-08-27 10:19:38 +080033 "tethering-client",
34 ],
35 manifest: "AndroidManifestBase.xml",
36}
37
38// Build tethering static library, used to compile both variants of the tethering.
39android_library {
40 name: "TetheringApiCurrentLib",
41 defaults: ["TetheringAndroidLibraryDefaults"],
42}
43
markchien810aa682019-10-23 16:27:52 +080044// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
45cc_library {
markchien6aa38892019-09-25 14:33:39 +080046 name: "libtetheroffloadjni",
47 srcs: [
48 "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
49 ],
50 shared_libs: [
markchien810aa682019-10-23 16:27:52 +080051 "libcgrouprc",
52 "libnativehelper_compat_libc++",
53 "libvndksupport",
markchien6aa38892019-09-25 14:33:39 +080054 ],
55 static_libs: [
markchien810aa682019-10-23 16:27:52 +080056 "android.hardware.tetheroffload.config@1.0",
markchien6aa38892019-09-25 14:33:39 +080057 "liblog",
58 "libbase",
markchien810aa682019-10-23 16:27:52 +080059 "libbinderthreadstate",
60 "libcutils",
markchien6aa38892019-09-25 14:33:39 +080061 "libhidlbase",
markchien810aa682019-10-23 16:27:52 +080062 "libjsoncpp",
63 "libprocessgroup",
markchien6aa38892019-09-25 14:33:39 +080064 "libutils",
65 ],
66
67 cflags: [
68 "-Wall",
69 "-Werror",
70 "-Wno-unused-parameter",
71 "-Wthread-safety",
72 ],
markchien810aa682019-10-23 16:27:52 +080073
74 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien6aa38892019-09-25 14:33:39 +080075}
76
markchien932da862019-08-27 10:19:38 +080077// Common defaults for compiling the actual APK.
78java_defaults {
79 name: "TetheringAppDefaults",
80 platform_apis: true,
81 privileged: true,
markchien810aa682019-10-23 16:27:52 +080082 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
83 // explicitly.
markchien6aa38892019-09-25 14:33:39 +080084 jni_libs: [
markchien810aa682019-10-23 16:27:52 +080085 "libcgrouprc",
86 "libnativehelper_compat_libc++",
87 "libvndksupport",
markchien6aa38892019-09-25 14:33:39 +080088 "libtetheroffloadjni",
89 ],
markchien932da862019-08-27 10:19:38 +080090 resource_dirs: [
91 "res",
92 ],
93 optimize: {
94 proguard_flags_files: ["proguard.flags"],
95 },
96}
97
98// Non-updatable tethering running in the system server process for devices not using the module
99// TODO: build in-process tethering APK here.
100
101// Updatable tethering packaged as an application
102android_app {
103 name: "Tethering",
104 defaults: ["TetheringAppDefaults"],
105 static_libs: ["TetheringApiCurrentLib"],
106 certificate: "networkstack",
107 manifest: "AndroidManifest.xml",
108 use_embedded_native_libs: true,
109 // The permission configuration *must* be included to ensure security of the device
110 required: ["NetworkPermissionConfig"],
111}
markchien43e97e02019-09-03 15:58:06 +0800112
113// This group will be removed when tethering migration is done.
114filegroup {
markchiendd6177b2019-09-23 20:29:54 +0800115 name: "tethering-servicescore-srcs",
markchien43e97e02019-09-03 15:58:06 +0800116 srcs: [
markchiendd6177b2019-09-23 20:29:54 +0800117 "src/com/android/server/connectivity/tethering/EntitlementManager.java",
markchien6aa38892019-09-25 14:33:39 +0800118 "src/com/android/server/connectivity/tethering/OffloadController.java",
119 "src/com/android/server/connectivity/tethering/OffloadHardwareInterface.java",
markchien43e97e02019-09-03 15:58:06 +0800120 "src/com/android/server/connectivity/tethering/TetheringConfiguration.java",
markchienf11a5da2019-09-23 21:39:39 +0800121 "src/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java",
markchiendd6177b2019-09-23 20:29:54 +0800122 ],
123}
124
125// This group will be removed when tethering migration is done.
126filegroup {
127 name: "tethering-servicesnet-srcs",
128 srcs: [
markchien74a4fa92019-09-09 20:50:49 +0800129 "src/android/net/dhcp/DhcpServerCallbacks.java",
130 "src/android/net/dhcp/DhcpServingParamsParcelExt.java",
131 "src/android/net/ip/IpServer.java",
132 "src/android/net/ip/RouterAdvertisementDaemon.java",
133 "src/android/net/util/InterfaceSet.java",
markchienf11a5da2019-09-23 21:39:39 +0800134 "src/android/net/util/PrefixUtils.java",
markchien43e97e02019-09-03 15:58:06 +0800135 ],
136}
markchien6aa38892019-09-25 14:33:39 +0800137
138// This group would be removed when tethering migration is done.
139filegroup {
140 name: "tethering-jni-srcs",
141 srcs: [
142 "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
143 ],
144}