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", |
| 19 | platform_apis: true, |
| 20 | srcs: [ |
| 21 | "src/**/*.java", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 22 | ":framework-tethering-shared-srcs", |
Remi NGUYEN VAN | 88998f4 | 2019-08-09 15:52:06 +0900 | [diff] [blame] | 23 | ":net-module-utils-srcs", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 24 | ":services-tethering-shared-srcs", |
markchien | dd6177b | 2019-09-23 20:29:54 +0800 | [diff] [blame] | 25 | ":servicescore-tethering-src", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 26 | ], |
| 27 | static_libs: [ |
| 28 | "androidx.annotation_annotation", |
markchien | 74a4fa9 | 2019-09-09 20:50:49 +0800 | [diff] [blame] | 29 | "netd_aidl_interface-java", |
Remi NGUYEN VAN | 88998f4 | 2019-08-09 15:52:06 +0900 | [diff] [blame] | 30 | "netlink-client", |
markchien | 74a4fa9 | 2019-09-09 20:50:49 +0800 | [diff] [blame] | 31 | "networkstack-aidl-interfaces-java", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 32 | "android.hardware.tetheroffload.control-V1.0-java", |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 33 | "tethering-client", |
| 34 | ], |
| 35 | manifest: "AndroidManifestBase.xml", |
| 36 | } |
| 37 | |
| 38 | // Build tethering static library, used to compile both variants of the tethering. |
| 39 | android_library { |
| 40 | name: "TetheringApiCurrentLib", |
| 41 | defaults: ["TetheringAndroidLibraryDefaults"], |
| 42 | } |
| 43 | |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 44 | // Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK). |
| 45 | cc_library { |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 46 | name: "libtetheroffloadjni", |
| 47 | srcs: [ |
| 48 | "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp", |
| 49 | ], |
| 50 | shared_libs: [ |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 51 | "libcgrouprc", |
| 52 | "libnativehelper_compat_libc++", |
| 53 | "libvndksupport", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 54 | ], |
| 55 | static_libs: [ |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 56 | "android.hardware.tetheroffload.config@1.0", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 57 | "liblog", |
| 58 | "libbase", |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 59 | "libbinderthreadstate", |
| 60 | "libcutils", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 61 | "libhidlbase", |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 62 | "libjsoncpp", |
| 63 | "libprocessgroup", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 64 | "libutils", |
| 65 | ], |
| 66 | |
| 67 | cflags: [ |
| 68 | "-Wall", |
| 69 | "-Werror", |
| 70 | "-Wno-unused-parameter", |
| 71 | "-Wthread-safety", |
| 72 | ], |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 73 | |
| 74 | ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"], |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 75 | } |
| 76 | |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 77 | // Common defaults for compiling the actual APK. |
| 78 | java_defaults { |
| 79 | name: "TetheringAppDefaults", |
| 80 | platform_apis: true, |
| 81 | privileged: true, |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 82 | // Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies |
| 83 | // explicitly. |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 84 | jni_libs: [ |
markchien | 810aa68 | 2019-10-23 16:27:52 +0800 | [diff] [blame^] | 85 | "libcgrouprc", |
| 86 | "libnativehelper_compat_libc++", |
| 87 | "libvndksupport", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 88 | "libtetheroffloadjni", |
| 89 | ], |
markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame] | 90 | resource_dirs: [ |
| 91 | "res", |
| 92 | ], |
| 93 | optimize: { |
| 94 | proguard_flags_files: ["proguard.flags"], |
| 95 | }, |
| 96 | } |
| 97 | |
| 98 | // Non-updatable tethering running in the system server process for devices not using the module |
| 99 | // TODO: build in-process tethering APK here. |
| 100 | |
| 101 | // Updatable tethering packaged as an application |
| 102 | android_app { |
| 103 | name: "Tethering", |
| 104 | defaults: ["TetheringAppDefaults"], |
| 105 | static_libs: ["TetheringApiCurrentLib"], |
| 106 | certificate: "networkstack", |
| 107 | manifest: "AndroidManifest.xml", |
| 108 | use_embedded_native_libs: true, |
| 109 | // The permission configuration *must* be included to ensure security of the device |
| 110 | required: ["NetworkPermissionConfig"], |
| 111 | } |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 112 | |
| 113 | // This group will be removed when tethering migration is done. |
| 114 | filegroup { |
markchien | dd6177b | 2019-09-23 20:29:54 +0800 | [diff] [blame] | 115 | name: "tethering-servicescore-srcs", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 116 | srcs: [ |
markchien | dd6177b | 2019-09-23 20:29:54 +0800 | [diff] [blame] | 117 | "src/com/android/server/connectivity/tethering/EntitlementManager.java", |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 118 | "src/com/android/server/connectivity/tethering/OffloadController.java", |
| 119 | "src/com/android/server/connectivity/tethering/OffloadHardwareInterface.java", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 120 | "src/com/android/server/connectivity/tethering/TetheringConfiguration.java", |
markchien | f11a5da | 2019-09-23 21:39:39 +0800 | [diff] [blame] | 121 | "src/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java", |
markchien | dd6177b | 2019-09-23 20:29:54 +0800 | [diff] [blame] | 122 | ], |
| 123 | } |
| 124 | |
| 125 | // This group will be removed when tethering migration is done. |
| 126 | filegroup { |
| 127 | name: "tethering-servicesnet-srcs", |
| 128 | srcs: [ |
markchien | 74a4fa9 | 2019-09-09 20:50:49 +0800 | [diff] [blame] | 129 | "src/android/net/dhcp/DhcpServerCallbacks.java", |
| 130 | "src/android/net/dhcp/DhcpServingParamsParcelExt.java", |
| 131 | "src/android/net/ip/IpServer.java", |
| 132 | "src/android/net/ip/RouterAdvertisementDaemon.java", |
| 133 | "src/android/net/util/InterfaceSet.java", |
markchien | f11a5da | 2019-09-23 21:39:39 +0800 | [diff] [blame] | 134 | "src/android/net/util/PrefixUtils.java", |
markchien | 43e97e0 | 2019-09-03 15:58:06 +0800 | [diff] [blame] | 135 | ], |
| 136 | } |
markchien | 6aa3889 | 2019-09-25 14:33:39 +0800 | [diff] [blame] | 137 | |
| 138 | // This group would be removed when tethering migration is done. |
| 139 | filegroup { |
| 140 | name: "tethering-jni-srcs", |
| 141 | srcs: [ |
| 142 | "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp", |
| 143 | ], |
| 144 | } |