blob: 596f62fad23e733ee578da0a79b6cf298071d144 [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",
markchien0df2ebc42019-09-30 14:40:57 +080028 "netd_aidl_interface-unstable-java",
Remi NGUYEN VAN882d8b32019-08-09 15:52:06 +090029 "netlink-client",
markchien0df2ebc42019-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 ],
markchien6d06f6d2019-12-16 20:15:20 +080033 libs: [
34 "framework-tethering",
35 ],
36
markchien017fef22019-08-27 10:19:38 +080037 manifest: "AndroidManifestBase.xml",
38}
39
40// Build tethering static library, used to compile both variants of the tethering.
41android_library {
42 name: "TetheringApiCurrentLib",
43 defaults: ["TetheringAndroidLibraryDefaults"],
44}
45
markchiend8676d92019-10-23 16:27:52 +080046// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
47cc_library {
markchien771c3e92019-12-07 22:02:28 +080048 name: "libtetherutilsjni",
markchien77c17be62019-09-25 14:33:39 +080049 srcs: [
markchien771c3e92019-12-07 22:02:28 +080050 "jni/android_net_util_TetheringUtils.cpp",
markchien77c17be62019-09-25 14:33:39 +080051 ],
52 shared_libs: [
markchiend8676d92019-10-23 16:27:52 +080053 "libcgrouprc",
54 "libnativehelper_compat_libc++",
55 "libvndksupport",
markchien77c17be62019-09-25 14:33:39 +080056 ],
57 static_libs: [
markchiend8676d92019-10-23 16:27:52 +080058 "android.hardware.tetheroffload.config@1.0",
markchien77c17be62019-09-25 14:33:39 +080059 "liblog",
60 "libbase",
markchiend8676d92019-10-23 16:27:52 +080061 "libbinderthreadstate",
62 "libcutils",
markchien77c17be62019-09-25 14:33:39 +080063 "libhidlbase",
markchiend8676d92019-10-23 16:27:52 +080064 "libjsoncpp",
65 "libprocessgroup",
markchien77c17be62019-09-25 14:33:39 +080066 "libutils",
67 ],
68
69 cflags: [
70 "-Wall",
71 "-Werror",
72 "-Wno-unused-parameter",
73 "-Wthread-safety",
74 ],
markchiend8676d92019-10-23 16:27:52 +080075
76 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien77c17be62019-09-25 14:33:39 +080077}
78
markchien017fef22019-08-27 10:19:38 +080079// Common defaults for compiling the actual APK.
80java_defaults {
81 name: "TetheringAppDefaults",
82 platform_apis: true,
83 privileged: true,
markchiend8676d92019-10-23 16:27:52 +080084 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
85 // explicitly.
markchien77c17be62019-09-25 14:33:39 +080086 jni_libs: [
markchiend8676d92019-10-23 16:27:52 +080087 "libcgrouprc",
88 "libnativehelper_compat_libc++",
89 "libvndksupport",
markchien771c3e92019-12-07 22:02:28 +080090 "libtetherutilsjni",
markchien77c17be62019-09-25 14:33:39 +080091 ],
markchien017fef22019-08-27 10:19:38 +080092 resource_dirs: [
93 "res",
94 ],
markchien6d06f6d2019-12-16 20:15:20 +080095 libs: [
96 "framework-tethering",
97 ],
98 jarjar_rules: "jarjar-rules.txt",
markchien017fef22019-08-27 10:19:38 +080099 optimize: {
100 proguard_flags_files: ["proguard.flags"],
101 },
102}
103
104// Non-updatable tethering running in the system server process for devices not using the module
markchien0df2ebc42019-09-30 14:40:57 +0800105android_app {
106 name: "InProcessTethering",
107 defaults: ["TetheringAppDefaults"],
108 static_libs: ["TetheringApiCurrentLib"],
109 certificate: "platform",
110 manifest: "AndroidManifest_InProcess.xml",
111 // InProcessTethering is a replacement for Tethering
112 overrides: ["Tethering"],
markchien0df2ebc42019-09-30 14:40:57 +0800113}
markchien017fef22019-08-27 10:19:38 +0800114
115// Updatable tethering packaged as an application
116android_app {
117 name: "Tethering",
118 defaults: ["TetheringAppDefaults"],
119 static_libs: ["TetheringApiCurrentLib"],
120 certificate: "networkstack",
121 manifest: "AndroidManifest.xml",
122 use_embedded_native_libs: true,
123 // The permission configuration *must* be included to ensure security of the device
124 required: ["NetworkPermissionConfig"],
125}