blob: d297f3f8418906bbe7ce0b4963511e180176ecc0 [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",
markchien92b8e7f2020-01-07 14:43:17 +080023 ":tethering-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",
Artur Satayev2d330f62019-12-10 17:47:53 +000035 "unsupportedappusage",
markchien6d06f6d2019-12-16 20:15:20 +080036 ],
37
markchien017fef22019-08-27 10:19:38 +080038 manifest: "AndroidManifestBase.xml",
39}
40
41// Build tethering static library, used to compile both variants of the tethering.
42android_library {
43 name: "TetheringApiCurrentLib",
44 defaults: ["TetheringAndroidLibraryDefaults"],
45}
46
markchiend8676d92019-10-23 16:27:52 +080047// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
48cc_library {
markchien771c3e92019-12-07 22:02:28 +080049 name: "libtetherutilsjni",
markchien77c17be62019-09-25 14:33:39 +080050 srcs: [
markchien771c3e92019-12-07 22:02:28 +080051 "jni/android_net_util_TetheringUtils.cpp",
markchien77c17be62019-09-25 14:33:39 +080052 ],
53 shared_libs: [
markchiend8676d92019-10-23 16:27:52 +080054 "libcgrouprc",
55 "libnativehelper_compat_libc++",
56 "libvndksupport",
markchien77c17be62019-09-25 14:33:39 +080057 ],
58 static_libs: [
markchiend8676d92019-10-23 16:27:52 +080059 "android.hardware.tetheroffload.config@1.0",
markchien77c17be62019-09-25 14:33:39 +080060 "liblog",
61 "libbase",
markchiend8676d92019-10-23 16:27:52 +080062 "libbinderthreadstate",
63 "libcutils",
markchien77c17be62019-09-25 14:33:39 +080064 "libhidlbase",
markchiend8676d92019-10-23 16:27:52 +080065 "libjsoncpp",
66 "libprocessgroup",
markchien77c17be62019-09-25 14:33:39 +080067 "libutils",
68 ],
69
70 cflags: [
71 "-Wall",
72 "-Werror",
73 "-Wno-unused-parameter",
74 "-Wthread-safety",
75 ],
markchiend8676d92019-10-23 16:27:52 +080076
77 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien77c17be62019-09-25 14:33:39 +080078}
79
markchien017fef22019-08-27 10:19:38 +080080// Common defaults for compiling the actual APK.
81java_defaults {
82 name: "TetheringAppDefaults",
83 platform_apis: true,
84 privileged: true,
markchiend8676d92019-10-23 16:27:52 +080085 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
86 // explicitly.
markchien77c17be62019-09-25 14:33:39 +080087 jni_libs: [
markchiend8676d92019-10-23 16:27:52 +080088 "libcgrouprc",
89 "libnativehelper_compat_libc++",
90 "libvndksupport",
markchien771c3e92019-12-07 22:02:28 +080091 "libtetherutilsjni",
markchien77c17be62019-09-25 14:33:39 +080092 ],
markchien017fef22019-08-27 10:19:38 +080093 resource_dirs: [
94 "res",
95 ],
markchien6d06f6d2019-12-16 20:15:20 +080096 libs: [
97 "framework-tethering",
98 ],
99 jarjar_rules: "jarjar-rules.txt",
markchien017fef22019-08-27 10:19:38 +0800100 optimize: {
101 proguard_flags_files: ["proguard.flags"],
102 },
103}
104
105// Non-updatable tethering running in the system server process for devices not using the module
markchien0df2ebc42019-09-30 14:40:57 +0800106android_app {
107 name: "InProcessTethering",
108 defaults: ["TetheringAppDefaults"],
109 static_libs: ["TetheringApiCurrentLib"],
110 certificate: "platform",
111 manifest: "AndroidManifest_InProcess.xml",
112 // InProcessTethering is a replacement for Tethering
113 overrides: ["Tethering"],
markchien0df2ebc42019-09-30 14:40:57 +0800114}
markchien017fef22019-08-27 10:19:38 +0800115
116// Updatable tethering packaged as an application
117android_app {
118 name: "Tethering",
119 defaults: ["TetheringAppDefaults"],
120 static_libs: ["TetheringApiCurrentLib"],
121 certificate: "networkstack",
122 manifest: "AndroidManifest.xml",
123 use_embedded_native_libs: true,
124 // The permission configuration *must* be included to ensure security of the device
125 required: ["NetworkPermissionConfig"],
Jiyong Park90247c82020-01-06 13:30:59 +0900126 apex_available: ["com.android.tethering"],
markchien017fef22019-08-27 10:19:38 +0800127}