markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | java_defaults { |
| 18 | name: "TetheringAndroidLibraryDefaults", |
Remi NGUYEN VAN | 63dc279 | 2020-01-31 15:05:22 +0900 | [diff] [blame^] | 19 | // TODO (b/146757305): change to module API once available |
| 20 | sdk_version: "core_platform", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 21 | srcs: [ |
| 22 | "src/**/*.java", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 23 | ":framework-tethering-shared-srcs", |
markchien | dac2826 | 2020-01-07 14:43:17 +0800 | [diff] [blame] | 24 | ":tethering-module-utils-srcs", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 25 | ":services-tethering-shared-srcs", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 26 | ], |
| 27 | static_libs: [ |
| 28 | "androidx.annotation_annotation", |
markchien | ee6ad37 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 29 | "netd_aidl_interface-unstable-java", |
Remi NGUYEN VAN | 88998f4 | 2019-08-09 15:52:06 +0900 | [diff] [blame] | 30 | "netlink-client", |
markchien | ee6ad37 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 31 | "networkstack-aidl-interfaces-unstable-java", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 32 | "android.hardware.tetheroffload.control-V1.0-java", |
markchien | 78c1bbc | 2020-01-14 17:28:47 +0800 | [diff] [blame] | 33 | "net-utils-framework-common", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 34 | ], |
markchien | 9d35382 | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 35 | libs: [ |
| 36 | "framework-tethering", |
Artur Satayev | 2e1ad6e | 2019-12-10 17:47:53 +0000 | [diff] [blame] | 37 | "unsupportedappusage", |
Remi NGUYEN VAN | 63dc279 | 2020-01-31 15:05:22 +0900 | [diff] [blame^] | 38 | "android_system_stubs_current", |
| 39 | "framework-res", |
markchien | 9d35382 | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 40 | ], |
markchien | 84a9282 | 2020-01-16 11:21:53 +0800 | [diff] [blame] | 41 | plugins: ["java_api_finder"], |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 42 | manifest: "AndroidManifestBase.xml", |
| 43 | } |
| 44 | |
| 45 | // Build tethering static library, used to compile both variants of the tethering. |
| 46 | android_library { |
| 47 | name: "TetheringApiCurrentLib", |
| 48 | defaults: ["TetheringAndroidLibraryDefaults"], |
| 49 | } |
| 50 | |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 51 | // Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK). |
| 52 | cc_library { |
markchien | f87ebdc | 2019-12-07 22:02:28 +0800 | [diff] [blame] | 53 | name: "libtetherutilsjni", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 54 | srcs: [ |
markchien | f87ebdc | 2019-12-07 22:02:28 +0800 | [diff] [blame] | 55 | "jni/android_net_util_TetheringUtils.cpp", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 56 | ], |
| 57 | shared_libs: [ |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 58 | "libcgrouprc", |
| 59 | "libnativehelper_compat_libc++", |
| 60 | "libvndksupport", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 61 | ], |
| 62 | static_libs: [ |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 63 | "android.hardware.tetheroffload.config@1.0", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 64 | "liblog", |
| 65 | "libbase", |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 66 | "libbinderthreadstate", |
| 67 | "libcutils", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 68 | "libhidlbase", |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 69 | "libjsoncpp", |
| 70 | "libprocessgroup", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 71 | "libutils", |
| 72 | ], |
| 73 | |
| 74 | cflags: [ |
| 75 | "-Wall", |
| 76 | "-Werror", |
| 77 | "-Wno-unused-parameter", |
| 78 | "-Wthread-safety", |
| 79 | ], |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 80 | |
| 81 | ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"], |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 82 | } |
| 83 | |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 84 | // Common defaults for compiling the actual APK. |
| 85 | java_defaults { |
| 86 | name: "TetheringAppDefaults", |
Remi NGUYEN VAN | 63dc279 | 2020-01-31 15:05:22 +0900 | [diff] [blame^] | 87 | // TODO (b/146757305): change to module API once available |
| 88 | sdk_version: "core_platform", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 89 | privileged: true, |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 90 | // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies |
| 91 | // explicitly. |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 92 | jni_libs: [ |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 93 | "libcgrouprc", |
| 94 | "libnativehelper_compat_libc++", |
| 95 | "libvndksupport", |
markchien | f87ebdc | 2019-12-07 22:02:28 +0800 | [diff] [blame] | 96 | "libtetherutilsjni", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 97 | ], |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 98 | resource_dirs: [ |
| 99 | "res", |
| 100 | ], |
markchien | 9d35382 | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 101 | libs: [ |
| 102 | "framework-tethering", |
Remi NGUYEN VAN | 63dc279 | 2020-01-31 15:05:22 +0900 | [diff] [blame^] | 103 | "android_system_stubs_current", |
| 104 | "framework-res", |
markchien | 9d35382 | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 105 | ], |
| 106 | jarjar_rules: "jarjar-rules.txt", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 107 | 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 |
markchien | ee6ad37 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 113 | android_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"], |
markchien | ee6ad37 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 121 | } |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 122 | |
| 123 | // Updatable tethering packaged as an application |
| 124 | android_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 Park | 489e09a | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 133 | apex_available: ["com.android.tethering"], |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 134 | } |