blob: 3c953b348ed9c06d8d34bd8b9f7ba7074f1b6dea [file] [log] [blame]
markchien017fef22019-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",
markchiena6ba54d2019-09-03 15:58:06 +080022 ":framework-tethering-shared-srcs",
Remi NGUYEN VAN882d8b32019-08-09 15:52:06 +090023 ":net-module-utils-srcs",
markchiena6ba54d2019-09-03 15:58:06 +080024 ":services-tethering-shared-srcs",
markchien017fef22019-08-27 10:19:38 +080025 ],
26 static_libs: [
27 "androidx.annotation_annotation",
markchien0f63ca62019-09-30 14:40:57 +080028 "netd_aidl_interface-unstable-java",
Remi NGUYEN VAN882d8b32019-08-09 15:52:06 +090029 "netlink-client",
markchien0f63ca62019-09-30 14:40:57 +080030 "networkstack-aidl-interfaces-unstable-java",
markchien77c17be62019-09-25 14:33:39 +080031 "android.hardware.tetheroffload.control-V1.0-java",
markchien017fef22019-08-27 10:19:38 +080032 "tethering-client",
33 ],
Artur Satayev6aa25ec2019-12-11 16:33:22 +000034 libs: ["unsupportedappusage"],
markchien017fef22019-08-27 10:19:38 +080035 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
markchienb3375162019-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 {
markchien77c17be62019-09-25 14:33:39 +080046 name: "libtetheroffloadjni",
47 srcs: [
48 "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
49 ],
50 shared_libs: [
markchienb3375162019-10-23 16:27:52 +080051 "libcgrouprc",
52 "libnativehelper_compat_libc++",
53 "libvndksupport",
markchien77c17be62019-09-25 14:33:39 +080054 ],
55 static_libs: [
markchienb3375162019-10-23 16:27:52 +080056 "android.hardware.tetheroffload.config@1.0",
markchien77c17be62019-09-25 14:33:39 +080057 "liblog",
58 "libbase",
markchienb3375162019-10-23 16:27:52 +080059 "libbinderthreadstate",
60 "libcutils",
markchien77c17be62019-09-25 14:33:39 +080061 "libhidlbase",
markchienb3375162019-10-23 16:27:52 +080062 "libjsoncpp",
63 "libprocessgroup",
markchien77c17be62019-09-25 14:33:39 +080064 "libutils",
65 ],
66
67 cflags: [
68 "-Wall",
69 "-Werror",
70 "-Wno-unused-parameter",
71 "-Wthread-safety",
72 ],
markchienb3375162019-10-23 16:27:52 +080073
74 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien77c17be62019-09-25 14:33:39 +080075}
76
markchien017fef22019-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,
markchienb3375162019-10-23 16:27:52 +080082 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
83 // explicitly.
markchien77c17be62019-09-25 14:33:39 +080084 jni_libs: [
markchienb3375162019-10-23 16:27:52 +080085 "libcgrouprc",
86 "libnativehelper_compat_libc++",
87 "libvndksupport",
markchien77c17be62019-09-25 14:33:39 +080088 "libtetheroffloadjni",
89 ],
markchien017fef22019-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
markchien0f63ca62019-09-30 14:40:57 +080099android_app {
100 name: "InProcessTethering",
101 defaults: ["TetheringAppDefaults"],
102 static_libs: ["TetheringApiCurrentLib"],
103 certificate: "platform",
104 manifest: "AndroidManifest_InProcess.xml",
105 // InProcessTethering is a replacement for Tethering
106 overrides: ["Tethering"],
107 // TODO: use PlatformNetworkPermissionConfig.
108}
markchien017fef22019-08-27 10:19:38 +0800109
110// Updatable tethering packaged as an application
111android_app {
112 name: "Tethering",
113 defaults: ["TetheringAppDefaults"],
114 static_libs: ["TetheringApiCurrentLib"],
115 certificate: "networkstack",
116 manifest: "AndroidManifest.xml",
117 use_embedded_native_libs: true,
118 // The permission configuration *must* be included to ensure security of the device
119 required: ["NetworkPermissionConfig"],
120}