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