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