blob: cf2b1f06d7696fc771b459d2387e9ab69219d569 [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",
markchien9574f5e2020-01-15 17:54:52 +080019 sdk_version: "system_current",
markchien932da862019-08-27 10:19:38 +080020 srcs: [
21 "src/**/*.java",
markchien43e97e02019-09-03 15:58:06 +080022 ":framework-tethering-shared-srcs",
markchien12c5bb82020-01-07 14:43:17 +080023 ":tethering-module-utils-srcs",
markchien43e97e02019-09-03 15:58:06 +080024 ":services-tethering-shared-srcs",
markchien932da862019-08-27 10:19:38 +080025 ],
26 static_libs: [
27 "androidx.annotation_annotation",
markchienee6ad372019-09-30 14:40:57 +080028 "netd_aidl_interface-unstable-java",
Remi NGUYEN VAN88998f42019-08-09 15:52:06 +090029 "netlink-client",
markchienee6ad372019-09-30 14:40:57 +080030 "networkstack-aidl-interfaces-unstable-java",
markchien6aa38892019-09-25 14:33:39 +080031 "android.hardware.tetheroffload.control-V1.0-java",
markchien75fc6ab2020-01-14 17:28:47 +080032 "net-utils-framework-common",
markchien932da862019-08-27 10:19:38 +080033 ],
markchien9d353822019-12-16 20:15:20 +080034 libs: [
35 "framework-tethering",
Artur Satayev4784fb02019-12-10 17:47:53 +000036 "unsupportedappusage",
markchien9d353822019-12-16 20:15:20 +080037 ],
markchien84a92822020-01-16 11:21:53 +080038 plugins: ["java_api_finder"],
markchien932da862019-08-27 10:19:38 +080039 manifest: "AndroidManifestBase.xml",
40}
41
42// Build tethering static library, used to compile both variants of the tethering.
43android_library {
44 name: "TetheringApiCurrentLib",
45 defaults: ["TetheringAndroidLibraryDefaults"],
46}
47
markchien810aa682019-10-23 16:27:52 +080048// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
49cc_library {
markchienf87ebdc2019-12-07 22:02:28 +080050 name: "libtetherutilsjni",
markchien6aa38892019-09-25 14:33:39 +080051 srcs: [
markchienf87ebdc2019-12-07 22:02:28 +080052 "jni/android_net_util_TetheringUtils.cpp",
markchien6aa38892019-09-25 14:33:39 +080053 ],
54 shared_libs: [
markchien810aa682019-10-23 16:27:52 +080055 "libcgrouprc",
56 "libnativehelper_compat_libc++",
57 "libvndksupport",
markchien6aa38892019-09-25 14:33:39 +080058 ],
59 static_libs: [
markchien810aa682019-10-23 16:27:52 +080060 "android.hardware.tetheroffload.config@1.0",
markchien6aa38892019-09-25 14:33:39 +080061 "liblog",
62 "libbase",
markchien810aa682019-10-23 16:27:52 +080063 "libbinderthreadstate",
64 "libcutils",
markchien6aa38892019-09-25 14:33:39 +080065 "libhidlbase",
markchien810aa682019-10-23 16:27:52 +080066 "libjsoncpp",
67 "libprocessgroup",
markchien6aa38892019-09-25 14:33:39 +080068 "libutils",
69 ],
70
71 cflags: [
72 "-Wall",
73 "-Werror",
74 "-Wno-unused-parameter",
75 "-Wthread-safety",
76 ],
markchien810aa682019-10-23 16:27:52 +080077
78 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien6aa38892019-09-25 14:33:39 +080079}
80
markchien932da862019-08-27 10:19:38 +080081// Common defaults for compiling the actual APK.
82java_defaults {
83 name: "TetheringAppDefaults",
markchien9574f5e2020-01-15 17:54:52 +080084 sdk_version: "system_current",
markchien932da862019-08-27 10:19:38 +080085 privileged: true,
markchien810aa682019-10-23 16:27:52 +080086 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
87 // explicitly.
markchien6aa38892019-09-25 14:33:39 +080088 jni_libs: [
markchien810aa682019-10-23 16:27:52 +080089 "libcgrouprc",
90 "libnativehelper_compat_libc++",
91 "libvndksupport",
markchienf87ebdc2019-12-07 22:02:28 +080092 "libtetherutilsjni",
markchien6aa38892019-09-25 14:33:39 +080093 ],
markchien932da862019-08-27 10:19:38 +080094 resource_dirs: [
95 "res",
96 ],
markchien9d353822019-12-16 20:15:20 +080097 libs: [
98 "framework-tethering",
99 ],
100 jarjar_rules: "jarjar-rules.txt",
markchien932da862019-08-27 10:19:38 +0800101 optimize: {
102 proguard_flags_files: ["proguard.flags"],
103 },
104}
105
106// Non-updatable tethering running in the system server process for devices not using the module
markchienee6ad372019-09-30 14:40:57 +0800107android_app {
108 name: "InProcessTethering",
109 defaults: ["TetheringAppDefaults"],
110 static_libs: ["TetheringApiCurrentLib"],
111 certificate: "platform",
112 manifest: "AndroidManifest_InProcess.xml",
113 // InProcessTethering is a replacement for Tethering
114 overrides: ["Tethering"],
markchienee6ad372019-09-30 14:40:57 +0800115}
markchien932da862019-08-27 10:19:38 +0800116
117// Updatable tethering packaged as an application
118android_app {
119 name: "Tethering",
120 defaults: ["TetheringAppDefaults"],
121 static_libs: ["TetheringApiCurrentLib"],
122 certificate: "networkstack",
123 manifest: "AndroidManifest.xml",
124 use_embedded_native_libs: true,
125 // The permission configuration *must* be included to ensure security of the device
126 required: ["NetworkPermissionConfig"],
Jiyong Park1eb89332020-01-06 13:30:59 +0900127 apex_available: ["com.android.tethering"],
markchien932da862019-08-27 10:19:38 +0800128}