markchien | 017fef2 | 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", |
| 19 | platform_apis: true, |
| 20 | srcs: [ |
| 21 | "src/**/*.java", |
markchien | a6ba54d | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 22 | ":framework-tethering-shared-srcs", |
markchien | 92b8e7f | 2020-01-07 14:43:17 +0800 | [diff] [blame] | 23 | ":tethering-module-utils-srcs", |
markchien | a6ba54d | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 24 | ":services-tethering-shared-srcs", |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 25 | ], |
| 26 | static_libs: [ |
| 27 | "androidx.annotation_annotation", |
markchien | 0df2ebc4 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 28 | "netd_aidl_interface-unstable-java", |
Remi NGUYEN VAN | 882d8b3 | 2019-08-09 15:52:06 +0900 | [diff] [blame] | 29 | "netlink-client", |
markchien | 0df2ebc4 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 30 | "networkstack-aidl-interfaces-unstable-java", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 31 | "android.hardware.tetheroffload.control-V1.0-java", |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 32 | ], |
markchien | 6d06f6d | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 33 | libs: [ |
| 34 | "framework-tethering", |
Artur Satayev | 2d330f6 | 2019-12-10 17:47:53 +0000 | [diff] [blame] | 35 | "unsupportedappusage", |
markchien | 6d06f6d | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 36 | ], |
| 37 | |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 38 | manifest: "AndroidManifestBase.xml", |
| 39 | } |
| 40 | |
| 41 | // Build tethering static library, used to compile both variants of the tethering. |
| 42 | android_library { |
| 43 | name: "TetheringApiCurrentLib", |
| 44 | defaults: ["TetheringAndroidLibraryDefaults"], |
| 45 | } |
| 46 | |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 47 | // Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK). |
| 48 | cc_library { |
markchien | 771c3e9 | 2019-12-07 22:02:28 +0800 | [diff] [blame] | 49 | name: "libtetherutilsjni", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 50 | srcs: [ |
markchien | 771c3e9 | 2019-12-07 22:02:28 +0800 | [diff] [blame] | 51 | "jni/android_net_util_TetheringUtils.cpp", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 52 | ], |
| 53 | shared_libs: [ |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 54 | "libcgrouprc", |
| 55 | "libnativehelper_compat_libc++", |
| 56 | "libvndksupport", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 57 | ], |
| 58 | static_libs: [ |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 59 | "android.hardware.tetheroffload.config@1.0", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 60 | "liblog", |
| 61 | "libbase", |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 62 | "libbinderthreadstate", |
| 63 | "libcutils", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 64 | "libhidlbase", |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 65 | "libjsoncpp", |
| 66 | "libprocessgroup", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 67 | "libutils", |
| 68 | ], |
| 69 | |
| 70 | cflags: [ |
| 71 | "-Wall", |
| 72 | "-Werror", |
| 73 | "-Wno-unused-parameter", |
| 74 | "-Wthread-safety", |
| 75 | ], |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 76 | |
| 77 | ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"], |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 78 | } |
| 79 | |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 80 | // Common defaults for compiling the actual APK. |
| 81 | java_defaults { |
| 82 | name: "TetheringAppDefaults", |
| 83 | platform_apis: true, |
| 84 | privileged: true, |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 85 | // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies |
| 86 | // explicitly. |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 87 | jni_libs: [ |
markchien | d8676d9 | 2019-10-23 16:27:52 +0800 | [diff] [blame] | 88 | "libcgrouprc", |
| 89 | "libnativehelper_compat_libc++", |
| 90 | "libvndksupport", |
markchien | 771c3e9 | 2019-12-07 22:02:28 +0800 | [diff] [blame] | 91 | "libtetherutilsjni", |
markchien | 77c17be6 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 92 | ], |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 93 | resource_dirs: [ |
| 94 | "res", |
| 95 | ], |
markchien | 6d06f6d | 2019-12-16 20:15:20 +0800 | [diff] [blame] | 96 | libs: [ |
| 97 | "framework-tethering", |
| 98 | ], |
| 99 | jarjar_rules: "jarjar-rules.txt", |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 100 | optimize: { |
| 101 | proguard_flags_files: ["proguard.flags"], |
| 102 | }, |
| 103 | } |
| 104 | |
| 105 | // Non-updatable tethering running in the system server process for devices not using the module |
markchien | 0df2ebc4 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 106 | android_app { |
| 107 | name: "InProcessTethering", |
| 108 | defaults: ["TetheringAppDefaults"], |
| 109 | static_libs: ["TetheringApiCurrentLib"], |
| 110 | certificate: "platform", |
| 111 | manifest: "AndroidManifest_InProcess.xml", |
| 112 | // InProcessTethering is a replacement for Tethering |
| 113 | overrides: ["Tethering"], |
markchien | 0df2ebc4 | 2019-09-30 14:40:57 +0800 | [diff] [blame] | 114 | } |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 115 | |
| 116 | // Updatable tethering packaged as an application |
| 117 | android_app { |
| 118 | name: "Tethering", |
| 119 | defaults: ["TetheringAppDefaults"], |
| 120 | static_libs: ["TetheringApiCurrentLib"], |
| 121 | certificate: "networkstack", |
| 122 | manifest: "AndroidManifest.xml", |
| 123 | use_embedded_native_libs: true, |
| 124 | // The permission configuration *must* be included to ensure security of the device |
| 125 | required: ["NetworkPermissionConfig"], |
Jiyong Park | 90247c8 | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 126 | apex_available: ["com.android.tethering"], |
markchien | 017fef2 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 127 | } |