blob: 1083adbced534ca62c07073bbb723453b6509e37 [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",
Remi NGUYEN VAN63dc2792020-01-31 15:05:22 +090019 // TODO (b/146757305): change to module API once available
20 sdk_version: "core_platform",
markchien932da862019-08-27 10:19:38 +080021 srcs: [
22 "src/**/*.java",
markchien43e97e02019-09-03 15:58:06 +080023 ":framework-tethering-shared-srcs",
markchiendac28262020-01-07 14:43:17 +080024 ":tethering-module-utils-srcs",
markchien43e97e02019-09-03 15:58:06 +080025 ":services-tethering-shared-srcs",
markchien932da862019-08-27 10:19:38 +080026 ],
27 static_libs: [
28 "androidx.annotation_annotation",
markchienee6ad372019-09-30 14:40:57 +080029 "netd_aidl_interface-unstable-java",
Remi NGUYEN VAN88998f42019-08-09 15:52:06 +090030 "netlink-client",
markchienee6ad372019-09-30 14:40:57 +080031 "networkstack-aidl-interfaces-unstable-java",
markchien6aa38892019-09-25 14:33:39 +080032 "android.hardware.tetheroffload.control-V1.0-java",
markchien78c1bbc2020-01-14 17:28:47 +080033 "net-utils-framework-common",
markchien932da862019-08-27 10:19:38 +080034 ],
markchien9d353822019-12-16 20:15:20 +080035 libs: [
36 "framework-tethering",
Artur Satayev2e1ad6e2019-12-10 17:47:53 +000037 "unsupportedappusage",
Remi NGUYEN VAN63dc2792020-01-31 15:05:22 +090038 "android_system_stubs_current",
39 "framework-res",
markchien9d353822019-12-16 20:15:20 +080040 ],
markchien84a92822020-01-16 11:21:53 +080041 plugins: ["java_api_finder"],
markchien932da862019-08-27 10:19:38 +080042 manifest: "AndroidManifestBase.xml",
43}
44
45// Build tethering static library, used to compile both variants of the tethering.
46android_library {
47 name: "TetheringApiCurrentLib",
48 defaults: ["TetheringAndroidLibraryDefaults"],
49}
50
markchien810aa682019-10-23 16:27:52 +080051// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
52cc_library {
markchienf87ebdc2019-12-07 22:02:28 +080053 name: "libtetherutilsjni",
markchien6aa38892019-09-25 14:33:39 +080054 srcs: [
markchienf87ebdc2019-12-07 22:02:28 +080055 "jni/android_net_util_TetheringUtils.cpp",
markchien6aa38892019-09-25 14:33:39 +080056 ],
57 shared_libs: [
markchien810aa682019-10-23 16:27:52 +080058 "libcgrouprc",
59 "libnativehelper_compat_libc++",
60 "libvndksupport",
markchien6aa38892019-09-25 14:33:39 +080061 ],
62 static_libs: [
markchien810aa682019-10-23 16:27:52 +080063 "android.hardware.tetheroffload.config@1.0",
markchien6aa38892019-09-25 14:33:39 +080064 "liblog",
65 "libbase",
markchien810aa682019-10-23 16:27:52 +080066 "libbinderthreadstate",
67 "libcutils",
markchien6aa38892019-09-25 14:33:39 +080068 "libhidlbase",
markchien810aa682019-10-23 16:27:52 +080069 "libjsoncpp",
70 "libprocessgroup",
markchien6aa38892019-09-25 14:33:39 +080071 "libutils",
72 ],
73
74 cflags: [
75 "-Wall",
76 "-Werror",
77 "-Wno-unused-parameter",
78 "-Wthread-safety",
79 ],
markchien810aa682019-10-23 16:27:52 +080080
81 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien6aa38892019-09-25 14:33:39 +080082}
83
markchien932da862019-08-27 10:19:38 +080084// Common defaults for compiling the actual APK.
85java_defaults {
86 name: "TetheringAppDefaults",
Remi NGUYEN VAN63dc2792020-01-31 15:05:22 +090087 // TODO (b/146757305): change to module API once available
88 sdk_version: "core_platform",
markchien932da862019-08-27 10:19:38 +080089 privileged: true,
markchien810aa682019-10-23 16:27:52 +080090 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
91 // explicitly.
markchien6aa38892019-09-25 14:33:39 +080092 jni_libs: [
markchien810aa682019-10-23 16:27:52 +080093 "libcgrouprc",
94 "libnativehelper_compat_libc++",
95 "libvndksupport",
markchienf87ebdc2019-12-07 22:02:28 +080096 "libtetherutilsjni",
markchien6aa38892019-09-25 14:33:39 +080097 ],
markchien932da862019-08-27 10:19:38 +080098 resource_dirs: [
99 "res",
100 ],
markchien9d353822019-12-16 20:15:20 +0800101 libs: [
102 "framework-tethering",
Remi NGUYEN VAN63dc2792020-01-31 15:05:22 +0900103 "android_system_stubs_current",
104 "framework-res",
markchien9d353822019-12-16 20:15:20 +0800105 ],
106 jarjar_rules: "jarjar-rules.txt",
markchien932da862019-08-27 10:19:38 +0800107 optimize: {
108 proguard_flags_files: ["proguard.flags"],
109 },
110}
111
112// Non-updatable tethering running in the system server process for devices not using the module
markchienee6ad372019-09-30 14:40:57 +0800113android_app {
114 name: "InProcessTethering",
115 defaults: ["TetheringAppDefaults"],
116 static_libs: ["TetheringApiCurrentLib"],
117 certificate: "platform",
118 manifest: "AndroidManifest_InProcess.xml",
119 // InProcessTethering is a replacement for Tethering
120 overrides: ["Tethering"],
markchienee6ad372019-09-30 14:40:57 +0800121}
markchien932da862019-08-27 10:19:38 +0800122
123// Updatable tethering packaged as an application
124android_app {
125 name: "Tethering",
126 defaults: ["TetheringAppDefaults"],
127 static_libs: ["TetheringApiCurrentLib"],
128 certificate: "networkstack",
129 manifest: "AndroidManifest.xml",
130 use_embedded_native_libs: true,
131 // The permission configuration *must* be included to ensure security of the device
132 required: ["NetworkPermissionConfig"],
Jiyong Park489e09a2020-01-06 13:30:59 +0900133 apex_available: ["com.android.tethering"],
markchien932da862019-08-27 10:19:38 +0800134}