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