blob: 7e8721d3cc70e98037426b9777d73337fce0e85a [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 ],
34 manifest: "AndroidManifestBase.xml",
35}
36
37// Build tethering static library, used to compile both variants of the tethering.
38android_library {
39 name: "TetheringApiCurrentLib",
40 defaults: ["TetheringAndroidLibraryDefaults"],
41}
42
markchienb3375162019-10-23 16:27:52 +080043// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
44cc_library {
markchien77c17be62019-09-25 14:33:39 +080045 name: "libtetheroffloadjni",
46 srcs: [
47 "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
48 ],
49 shared_libs: [
markchienb3375162019-10-23 16:27:52 +080050 "libcgrouprc",
51 "libnativehelper_compat_libc++",
52 "libvndksupport",
markchien77c17be62019-09-25 14:33:39 +080053 ],
54 static_libs: [
markchienb3375162019-10-23 16:27:52 +080055 "android.hardware.tetheroffload.config@1.0",
markchien77c17be62019-09-25 14:33:39 +080056 "liblog",
57 "libbase",
markchienb3375162019-10-23 16:27:52 +080058 "libbinderthreadstate",
59 "libcutils",
markchien77c17be62019-09-25 14:33:39 +080060 "libhidlbase",
markchienb3375162019-10-23 16:27:52 +080061 "libjsoncpp",
62 "libprocessgroup",
markchien77c17be62019-09-25 14:33:39 +080063 "libutils",
64 ],
65
66 cflags: [
67 "-Wall",
68 "-Werror",
69 "-Wno-unused-parameter",
70 "-Wthread-safety",
71 ],
markchienb3375162019-10-23 16:27:52 +080072
73 ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
markchien77c17be62019-09-25 14:33:39 +080074}
75
markchien017fef22019-08-27 10:19:38 +080076// Common defaults for compiling the actual APK.
77java_defaults {
78 name: "TetheringAppDefaults",
79 platform_apis: true,
80 privileged: true,
markchienb3375162019-10-23 16:27:52 +080081 // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
82 // explicitly.
markchien77c17be62019-09-25 14:33:39 +080083 jni_libs: [
markchienb3375162019-10-23 16:27:52 +080084 "libcgrouprc",
85 "libnativehelper_compat_libc++",
86 "libvndksupport",
markchien77c17be62019-09-25 14:33:39 +080087 "libtetheroffloadjni",
88 ],
markchien017fef22019-08-27 10:19:38 +080089 resource_dirs: [
90 "res",
91 ],
92 optimize: {
93 proguard_flags_files: ["proguard.flags"],
94 },
95}
96
97// Non-updatable tethering running in the system server process for devices not using the module
markchien0f63ca62019-09-30 14:40:57 +080098android_app {
99 name: "InProcessTethering",
100 defaults: ["TetheringAppDefaults"],
101 static_libs: ["TetheringApiCurrentLib"],
102 certificate: "platform",
103 manifest: "AndroidManifest_InProcess.xml",
104 // InProcessTethering is a replacement for Tethering
105 overrides: ["Tethering"],
106 // TODO: use PlatformNetworkPermissionConfig.
107}
markchien017fef22019-08-27 10:19:38 +0800108
109// Updatable tethering packaged as an application
110android_app {
111 name: "Tethering",
112 defaults: ["TetheringAppDefaults"],
113 static_libs: ["TetheringApiCurrentLib"],
114 certificate: "networkstack",
115 manifest: "AndroidManifest.xml",
116 use_embedded_native_libs: true,
117 // The permission configuration *must* be included to ensure security of the device
118 required: ["NetworkPermissionConfig"],
119}