| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 1 | // | 
|  | 2 | // Copyright (C) 2020 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 |  | 
| Bob Badour | 6c7ed9d | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 17 | package { | 
|  | 18 | // See: http://go/android-license-faq | 
| Baligh Uddin | 3684713 | 2021-05-23 16:38:40 +0000 | [diff] [blame] | 19 | default_applicable_licenses: ["Android-Apache-2.0"], | 
| Bob Badour | 6c7ed9d | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 20 | } | 
|  | 21 |  | 
| Tyler Wear | b37f551 | 2021-10-01 13:22:00 -0700 | [diff] [blame] | 22 | aidl_interface { | 
|  | 23 | name: "connectivity_native_aidl_interface", | 
|  | 24 | local_include_dir: "binder", | 
| Tyler Wear | b37f551 | 2021-10-01 13:22:00 -0700 | [diff] [blame] | 25 | srcs: [ | 
|  | 26 | "binder/android/net/connectivity/aidl/*.aidl", | 
|  | 27 | ], | 
|  | 28 | backend: { | 
|  | 29 | java: { | 
|  | 30 | apex_available: [ | 
|  | 31 | "com.android.tethering", | 
|  | 32 | ], | 
|  | 33 | min_sdk_version: "30", | 
|  | 34 | }, | 
|  | 35 | ndk: { | 
|  | 36 | apex_available: [ | 
|  | 37 | "com.android.tethering", | 
|  | 38 | ], | 
|  | 39 | min_sdk_version: "30", | 
|  | 40 | }, | 
|  | 41 | }, | 
|  | 42 | versions: ["1"], | 
|  | 43 |  | 
|  | 44 | } | 
|  | 45 |  | 
|  | 46 | cc_library_static { | 
|  | 47 | name: "connectivity_native_aidl_interface-lateststable-ndk", | 
|  | 48 | min_sdk_version: "30", | 
|  | 49 | whole_static_libs: [ | 
|  | 50 | "connectivity_native_aidl_interface-V1-ndk", | 
|  | 51 | ], | 
|  | 52 | apex_available: [ | 
|  | 53 | "com.android.tethering", | 
|  | 54 | ], | 
|  | 55 | } | 
|  | 56 |  | 
|  | 57 | java_library { | 
|  | 58 | name: "connectivity_native_aidl_interface-lateststable-java", | 
|  | 59 | sdk_version: "system_current", | 
|  | 60 | min_sdk_version: "30", | 
|  | 61 | static_libs: [ | 
|  | 62 | "connectivity_native_aidl_interface-V1-java", | 
|  | 63 | ], | 
|  | 64 | apex_available: [ | 
|  | 65 | "com.android.tethering", | 
|  | 66 | ], | 
|  | 67 | } | 
|  | 68 |  | 
| markchien | 8fb75e3 | 2021-11-11 17:53:56 +0800 | [diff] [blame] | 69 | // The library name match the service-connectivity jarjar rules that put the JNI utils in the | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 70 | // android.net.connectivity.com.android.net.module.util package. | 
| markchien | 8fb75e3 | 2021-11-11 17:53:56 +0800 | [diff] [blame] | 71 | cc_library_shared { | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 72 | name: "libandroid_net_connectivity_com_android_net_module_util_jni", | 
| markchien | 8fb75e3 | 2021-11-11 17:53:56 +0800 | [diff] [blame] | 73 | min_sdk_version: "30", | 
|  | 74 | cflags: [ | 
|  | 75 | "-Wall", | 
|  | 76 | "-Werror", | 
|  | 77 | "-Wno-unused-parameter", | 
|  | 78 | "-Wthread-safety", | 
|  | 79 | ], | 
|  | 80 | srcs: [ | 
|  | 81 | "jni/com_android_net_module_util/onload.cpp", | 
|  | 82 | ], | 
| markchien | 8fb75e3 | 2021-11-11 17:53:56 +0800 | [diff] [blame] | 83 | static_libs: [ | 
|  | 84 | "libnet_utils_device_common_bpfjni", | 
| Tyler Wear | b37f551 | 2021-10-01 13:22:00 -0700 | [diff] [blame] | 85 | "libnet_utils_device_common_bpfutils", | 
| markchien | 8fb75e3 | 2021-11-11 17:53:56 +0800 | [diff] [blame] | 86 | ], | 
|  | 87 | shared_libs: [ | 
|  | 88 | "liblog", | 
|  | 89 | "libnativehelper", | 
|  | 90 | ], | 
|  | 91 | apex_available: [ | 
|  | 92 | "com.android.tethering", | 
|  | 93 | ], | 
|  | 94 | } | 
|  | 95 |  | 
| Remi NGUYEN VAN | eaa9658 | 2021-01-08 01:19:44 +0000 | [diff] [blame] | 96 | cc_library_shared { | 
|  | 97 | name: "libservice-connectivity", | 
| Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 98 | min_sdk_version: "30", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 99 | cflags: [ | 
|  | 100 | "-Wall", | 
|  | 101 | "-Werror", | 
|  | 102 | "-Wno-unused-parameter", | 
|  | 103 | "-Wthread-safety", | 
|  | 104 | ], | 
|  | 105 | srcs: [ | 
| Remi NGUYEN VAN | d950489 | 2022-02-02 13:03:29 +0900 | [diff] [blame] | 106 | ":services.connectivity-netstats-jni-sources", | 
| Patrick Rohr | 361b859 | 2022-01-28 15:39:17 +0100 | [diff] [blame] | 107 | "jni/com_android_server_BpfNetMaps.cpp", | 
| Hungming Chen | e2cf055 | 2021-12-25 17:05:41 +0800 | [diff] [blame] | 108 | "jni/com_android_server_connectivity_ClatCoordinator.cpp", | 
| Patrick Rohr | 361b859 | 2022-01-28 15:39:17 +0100 | [diff] [blame] | 109 | "jni/com_android_server_TestNetworkService.cpp", | 
| Remi NGUYEN VAN | eaa9658 | 2021-01-08 01:19:44 +0000 | [diff] [blame] | 110 | "jni/onload.cpp", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 111 | ], | 
| Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 112 | header_libs: [ | 
| Patrick Rohr | 361b859 | 2022-01-28 15:39:17 +0100 | [diff] [blame] | 113 | "bpf_connectivity_headers", | 
| Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 114 | ], | 
| Hungming Chen | e2cf055 | 2021-12-25 17:05:41 +0800 | [diff] [blame] | 115 | static_libs: [ | 
|  | 116 | "libclat", | 
|  | 117 | "libip_checksum", | 
| Remi NGUYEN VAN | d950489 | 2022-02-02 13:03:29 +0900 | [diff] [blame] | 118 | "libmodules-utils-build", | 
| Hungming Chen | e2cf055 | 2021-12-25 17:05:41 +0800 | [diff] [blame] | 119 | "libnetjniutils", | 
| Remi NGUYEN VAN | d950489 | 2022-02-02 13:03:29 +0900 | [diff] [blame] | 120 | "libnet_utils_device_common_bpfjni", | 
| Patrick Rohr | 361b859 | 2022-01-28 15:39:17 +0100 | [diff] [blame] | 121 | "libtraffic_controller", | 
|  | 122 | "netd_aidl_interface-lateststable-ndk", | 
| Hungming Chen | e2cf055 | 2021-12-25 17:05:41 +0800 | [diff] [blame] | 123 | ], | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 124 | shared_libs: [ | 
| Maciej Żenczykowski | dcae351 | 2022-01-31 19:59:32 -0800 | [diff] [blame] | 125 | "libbase", | 
| Remi NGUYEN VAN | d950489 | 2022-02-02 13:03:29 +0900 | [diff] [blame] | 126 | "libcutils", | 
| Maciej Żenczykowski | dcae351 | 2022-01-31 19:59:32 -0800 | [diff] [blame] | 127 | "libnetdutils", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 128 | "liblog", | 
|  | 129 | "libnativehelper", | 
| Remi NGUYEN VAN | d950489 | 2022-02-02 13:03:29 +0900 | [diff] [blame] | 130 | "libnetworkstats", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 131 | ], | 
| Pete Bentley | b145611 | 2021-01-07 13:51:18 +0000 | [diff] [blame] | 132 | apex_available: [ | 
| Remi NGUYEN VAN | eaa9658 | 2021-01-08 01:19:44 +0000 | [diff] [blame] | 133 | "com.android.tethering", | 
| Pete Bentley | b145611 | 2021-01-07 13:51:18 +0000 | [diff] [blame] | 134 | ], | 
|  | 135 | } | 
|  | 136 |  | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 137 | java_library { | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 138 | name: "service-connectivity-pre-jarjar", | 
| Remi NGUYEN VAN | 4ee6c50 | 2021-03-22 10:25:12 +0000 | [diff] [blame] | 139 | sdk_version: "system_server_current", | 
| Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 140 | min_sdk_version: "30", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 141 | srcs: [ | 
| Remi NGUYEN VAN | cdb45f8 | 2021-05-13 12:53:15 +0000 | [diff] [blame] | 142 | "src/**/*.java", | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 143 | ":framework-connectivity-shared-srcs", | 
| Remi NGUYEN VAN | 4ee6c50 | 2021-03-22 10:25:12 +0000 | [diff] [blame] | 144 | ":services-connectivity-shared-srcs", | 
| Motomu Utsumi | 166f966 | 2022-09-01 10:35:29 +0900 | [diff] [blame] | 145 | ":statslog-connectivity-java-gen", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 146 | ], | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 147 | libs: [ | 
| Remi NGUYEN VAN | 4ee6c50 | 2021-03-22 10:25:12 +0000 | [diff] [blame] | 148 | "framework-annotations-lib", | 
| Hassan Ali | c4f63fa | 2022-11-17 16:13:48 +0000 | [diff] [blame] | 149 | "framework-configinfrastructure", | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 150 | "framework-connectivity-pre-jarjar", | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 151 | // The framework-connectivity-t library is only available on T+ platforms | 
|  | 152 | // so any calls to it must be protected with a check to ensure that it is | 
|  | 153 | // available. The linter will detect any unprotected calls through an API | 
|  | 154 | // but not direct calls to the implementation. So, this depends on the | 
|  | 155 | // module lib stubs directly to ensure the linter will work correctly | 
|  | 156 | // as depending on framework-connectivity-t would cause it to be compiled | 
|  | 157 | // against the implementation because the two libraries are in the same | 
|  | 158 | // APEX. | 
| paulhu | 537f720 | 2022-02-08 21:25:28 +0800 | [diff] [blame] | 159 | "framework-connectivity-t.stubs.module_lib", | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 160 | "framework-tethering", | 
|  | 161 | "framework-wifi", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 162 | "unsupportedappusage", | 
| Remi NGUYEN VAN | 907ebd4 | 2021-03-08 22:05:03 +0900 | [diff] [blame] | 163 | "ServiceConnectivityResources", | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 164 | "framework-statsd", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 165 | ], | 
|  | 166 | static_libs: [ | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 167 | // Do not add libs here if they are already included | 
|  | 168 | // in framework-connectivity | 
| Hungming Chen | 01f2550 | 2022-06-28 22:47:00 +0800 | [diff] [blame] | 169 | "connectivity-net-module-utils-bpf", | 
| Tyler Wear | b37f551 | 2021-10-01 13:22:00 -0700 | [diff] [blame] | 170 | "connectivity_native_aidl_interface-lateststable-java", | 
| Remi NGUYEN VAN | 30bebea | 2021-08-06 14:15:31 +0900 | [diff] [blame] | 171 | "dnsresolver_aidl_interface-V9-java", | 
| William Escande | ea9e22e | 2021-08-19 12:26:52 +0200 | [diff] [blame] | 172 | "modules-utils-shell-command-handler", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 173 | "net-utils-device-common", | 
| markchien | 8fb75e3 | 2021-11-11 17:53:56 +0800 | [diff] [blame] | 174 | "net-utils-device-common-bpf", | 
| Patrick Rohr | 734f24e | 2022-08-09 19:23:18 -0700 | [diff] [blame] | 175 | "net-utils-device-common-ip", | 
| Xiao Ma | 09c0727 | 2021-07-01 14:00:34 +0000 | [diff] [blame] | 176 | "net-utils-device-common-netlink", | 
| Xiao Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 177 | "net-utils-services-common", | 
| lucaslin | ef33753 | 2021-01-18 11:58:24 +0800 | [diff] [blame] | 178 | "netd-client", | 
| Remi NGUYEN VAN | 4ee6c50 | 2021-03-22 10:25:12 +0000 | [diff] [blame] | 179 | "networkstack-client", | 
| lifr | c0d25c1 | 2021-03-09 17:24:46 +0800 | [diff] [blame] | 180 | "PlatformProperties", | 
| Remi NGUYEN VAN | d8bc0fa | 2021-03-11 15:41:52 +0900 | [diff] [blame] | 181 | "service-connectivity-protos", | 
| Frank Li | ec8c31d | 2022-11-15 02:59:05 +0000 | [diff] [blame] | 182 | // TODO: Adding the stats protos currently affects test coverage. | 
|  | 183 | // So remove the protos in ConnectivityService until all | 
|  | 184 | // tests for proto apis are added. | 
|  | 185 | //"service-connectivity-stats-protos", | 
| Remi NGUYEN VAN | ed02d61 | 2022-05-13 16:36:55 +0900 | [diff] [blame] | 186 | "NetworkStackApiStableShims", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 187 | ], | 
|  | 188 | apex_available: [ | 
| Remi NGUYEN VAN | eaa9658 | 2021-01-08 01:19:44 +0000 | [diff] [blame] | 189 | "com.android.tethering", | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 190 | ], | 
| Chiachang Wang | 3bc5276 | 2021-11-25 14:17:57 +0800 | [diff] [blame] | 191 | lint: { strict_updatability_linting: true }, | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 192 | visibility: [ | 
|  | 193 | "//packages/modules/Connectivity/service-t", | 
|  | 194 | "//packages/modules/Connectivity/tests:__subpackages__", | 
|  | 195 | ], | 
| Remi NGUYEN VAN | 59262cb | 2020-12-21 18:40:08 +0900 | [diff] [blame] | 196 | } | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 197 |  | 
| Paul Hu | 3e1f448 | 2022-05-16 20:56:32 +0800 | [diff] [blame] | 198 | // TODO: Remove this temporary library and put code into module when test coverage is enough. | 
|  | 199 | java_library { | 
|  | 200 | name: "service-mdns", | 
|  | 201 | sdk_version: "system_server_current", | 
|  | 202 | min_sdk_version: "30", | 
|  | 203 | srcs: [ | 
|  | 204 | "mdns/**/*.java", | 
|  | 205 | ], | 
|  | 206 | libs: [ | 
|  | 207 | "framework-annotations-lib", | 
|  | 208 | "framework-connectivity-pre-jarjar", | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 209 | "framework-wifi", | 
| Paul Hu | 3e1f448 | 2022-05-16 20:56:32 +0800 | [diff] [blame] | 210 | "service-connectivity-pre-jarjar", | 
|  | 211 | ], | 
|  | 212 | visibility: [ | 
|  | 213 | "//packages/modules/Connectivity/tests:__subpackages__", | 
|  | 214 | ], | 
|  | 215 | } | 
|  | 216 |  | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 217 | java_library { | 
| Remi NGUYEN VAN | d8bc0fa | 2021-03-11 15:41:52 +0900 | [diff] [blame] | 218 | name: "service-connectivity-protos", | 
| Remi NGUYEN VAN | 4ee6c50 | 2021-03-22 10:25:12 +0000 | [diff] [blame] | 219 | sdk_version: "system_current", | 
| Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 220 | min_sdk_version: "30", | 
| Remi NGUYEN VAN | d8bc0fa | 2021-03-11 15:41:52 +0900 | [diff] [blame] | 221 | proto: { | 
|  | 222 | type: "nano", | 
|  | 223 | }, | 
|  | 224 | srcs: [ | 
|  | 225 | ":system-messages-proto-src", | 
|  | 226 | ], | 
|  | 227 | libs: ["libprotobuf-java-nano"], | 
|  | 228 | apex_available: [ | 
| Remi NGUYEN VAN | d8bc0fa | 2021-03-11 15:41:52 +0900 | [diff] [blame] | 229 | "com.android.tethering", | 
|  | 230 | ], | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 231 | lint: { | 
|  | 232 | strict_updatability_linting: true, | 
|  | 233 | }, | 
| Remi NGUYEN VAN | d8bc0fa | 2021-03-11 15:41:52 +0900 | [diff] [blame] | 234 | } | 
|  | 235 |  | 
| Paul Duffin | 5fc809f | 2022-05-20 14:15:42 +0000 | [diff] [blame] | 236 | java_defaults { | 
|  | 237 | name: "service-connectivity-defaults", | 
| Remi NGUYEN VAN | 4ee6c50 | 2021-03-22 10:25:12 +0000 | [diff] [blame] | 238 | sdk_version: "system_server_current", | 
| Remi NGUYEN VAN | da43ef0 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 239 | min_sdk_version: "30", | 
| zhidou | b33a263 | 2022-09-06 17:58:20 +0000 | [diff] [blame] | 240 | defaults: [ | 
|  | 241 | "standalone-system-server-module-optimize-defaults", | 
|  | 242 | ], | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 243 | // This library combines system server jars that have access to different bootclasspath jars. | 
|  | 244 | // Lower SDK service jars must not depend on higher SDK jars as that would let them | 
|  | 245 | // transitively depend on the wrong bootclasspath jars. Sources also cannot be added here as | 
| Remi NGUYEN VAN | 371e7f7 | 2022-07-25 18:52:58 +0900 | [diff] [blame] | 246 | // they would depend on bootclasspath jars that may not be available. | 
| lifr | c0d25c1 | 2021-03-09 17:24:46 +0800 | [diff] [blame] | 247 | static_libs: [ | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 248 | "service-connectivity-pre-jarjar", | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 249 | "service-connectivity-tiramisu-pre-jarjar", | 
| Remi NGUYEN VAN | b6cde3d | 2022-03-10 04:32:15 +0000 | [diff] [blame] | 250 | "service-nearby-pre-jarjar", | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 251 | ], | 
| Remi NGUYEN VAN | 371e7f7 | 2022-07-25 18:52:58 +0900 | [diff] [blame] | 252 | // The below libraries are not actually needed to build since no source is compiled | 
|  | 253 | // (only combining prebuilt static_libs), but they are necessary so that R8 has the right | 
|  | 254 | // references to optimize the code. Without these, there will be missing class warnings and | 
|  | 255 | // code may be wrongly optimized. | 
|  | 256 | // R8 runs after jarjar, so the framework-X libraries need to be the post-jarjar artifacts | 
|  | 257 | // (.impl), if they are not just stubs, so that the name of jarjared classes match. | 
|  | 258 | libs: [ | 
|  | 259 | "androidx.annotation_annotation", | 
|  | 260 | "framework-annotations-lib", | 
|  | 261 | "framework-connectivity.impl", | 
|  | 262 | "framework-connectivity-t.impl", | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 263 | "framework-tethering", | 
|  | 264 | "framework-wifi", | 
| Remi NGUYEN VAN | 371e7f7 | 2022-07-25 18:52:58 +0900 | [diff] [blame] | 265 | "libprotobuf-java-nano", | 
|  | 266 | ], | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 267 | jarjar_rules: ":connectivity-jarjar-rules", | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 268 | apex_available: [ | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 269 | "com.android.tethering", | 
|  | 270 | ], | 
| Remi NGUYEN VAN | c6f8fb0 | 2022-04-20 18:58:53 +0900 | [diff] [blame] | 271 | optimize: { | 
| Remi NGUYEN VAN | c6f8fb0 | 2022-04-20 18:58:53 +0900 | [diff] [blame] | 272 | proguard_flags_files: ["proguard.flags"], | 
|  | 273 | }, | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 274 | lint: { | 
|  | 275 | strict_updatability_linting: true, | 
|  | 276 | }, | 
| Aaron Huang | 6333884 | 2021-01-08 18:32:00 +0800 | [diff] [blame] | 277 | } | 
| Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 278 |  | 
| Paul Duffin | 5fc809f | 2022-05-20 14:15:42 +0000 | [diff] [blame] | 279 | // A special library created strictly for use by the tests as they need the | 
|  | 280 | // implementation library but that is not available when building from prebuilts. | 
|  | 281 | // Using a library with a different name to what is used by the prebuilts ensures | 
|  | 282 | // that this will never depend on the prebuilt. | 
|  | 283 | // Switching service-connectivity to a java_sdk_library would also have worked as | 
|  | 284 | // that has built in support for managing this but that is too big a change at this | 
|  | 285 | // point. | 
|  | 286 | java_library { | 
|  | 287 | name: "service-connectivity-for-tests", | 
|  | 288 | defaults: ["service-connectivity-defaults"], | 
|  | 289 | } | 
|  | 290 |  | 
|  | 291 | java_library { | 
|  | 292 | name: "service-connectivity", | 
|  | 293 | defaults: ["service-connectivity-defaults"], | 
|  | 294 | installable: true, | 
|  | 295 | } | 
|  | 296 |  | 
| Frank Li | e6b47f3 | 2022-10-25 18:57:10 +0000 | [diff] [blame] | 297 | java_library_static { | 
|  | 298 | name: "service-connectivity-stats-protos", | 
|  | 299 | sdk_version: "system_current", | 
|  | 300 | min_sdk_version: "30", | 
|  | 301 | proto: { | 
|  | 302 | type: "lite", | 
|  | 303 | }, | 
|  | 304 | srcs: [ | 
|  | 305 | "src/com/android/metrics/stats.proto", | 
|  | 306 | ], | 
|  | 307 | static_libs: ["ConnectivityServiceprotos"], | 
|  | 308 | apex_available: ["com.android.tethering"], | 
|  | 309 | } | 
|  | 310 |  | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 311 | genrule { | 
| Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 312 | name: "connectivity-jarjar-rules", | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 313 | defaults: ["jarjar-rules-combine-defaults"], | 
|  | 314 | srcs: [ | 
|  | 315 | ":framework-connectivity-jarjar-rules", | 
|  | 316 | ":service-connectivity-jarjar-gen", | 
|  | 317 | ":service-nearby-jarjar-gen", | 
|  | 318 | ], | 
|  | 319 | out: ["connectivity-jarjar-rules.txt"], | 
| Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 320 | visibility: ["//packages/modules/Connectivity:__subpackages__"], | 
|  | 321 | } | 
| Wayne Ma | 0ea3bdc | 2022-01-12 01:12:11 +0800 | [diff] [blame] | 322 |  | 
|  | 323 | // TODO: This filegroup temporary exposes for NetworkStats. It should be | 
|  | 324 | // removed right after NetworkStats moves into mainline module. | 
|  | 325 | filegroup { | 
|  | 326 | name: "traffic-controller-utils", | 
|  | 327 | srcs: ["src/com/android/server/BpfNetMaps.java"], | 
|  | 328 | visibility: ["//packages/modules/Connectivity:__subpackages__"], | 
|  | 329 | } | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 330 |  | 
|  | 331 | java_genrule { | 
|  | 332 | name: "service-connectivity-jarjar-gen", | 
|  | 333 | tool_files: [ | 
|  | 334 | ":service-connectivity-pre-jarjar{.jar}", | 
|  | 335 | ":service-connectivity-tiramisu-pre-jarjar{.jar}", | 
|  | 336 | "jarjar-excludes.txt", | 
|  | 337 | ], | 
|  | 338 | tools: [ | 
|  | 339 | "jarjar-rules-generator", | 
|  | 340 | ], | 
|  | 341 | out: ["service_connectivity_jarjar_rules.txt"], | 
|  | 342 | cmd: "$(location jarjar-rules-generator) " + | 
| Remi NGUYEN VAN | 0bd90f1 | 2022-08-10 20:15:46 +0900 | [diff] [blame] | 343 | "$(location :service-connectivity-pre-jarjar{.jar}) " + | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 344 | "$(location :service-connectivity-tiramisu-pre-jarjar{.jar}) " + | 
|  | 345 | "--prefix android.net.connectivity " + | 
|  | 346 | "--excludes $(location jarjar-excludes.txt) " + | 
|  | 347 | "--output $(out)", | 
|  | 348 | visibility: ["//visibility:private"], | 
|  | 349 | } | 
|  | 350 |  | 
|  | 351 | java_genrule { | 
|  | 352 | name: "service-nearby-jarjar-gen", | 
|  | 353 | tool_files: [ | 
|  | 354 | ":service-nearby-pre-jarjar{.jar}", | 
|  | 355 | "jarjar-excludes.txt", | 
|  | 356 | ], | 
|  | 357 | tools: [ | 
|  | 358 | "jarjar-rules-generator", | 
|  | 359 | ], | 
|  | 360 | out: ["service_nearby_jarjar_rules.txt"], | 
|  | 361 | cmd: "$(location jarjar-rules-generator) " + | 
| Remi NGUYEN VAN | 0bd90f1 | 2022-08-10 20:15:46 +0900 | [diff] [blame] | 362 | "$(location :service-nearby-pre-jarjar{.jar}) " + | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 363 | "--prefix com.android.server.nearby " + | 
|  | 364 | "--excludes $(location jarjar-excludes.txt) " + | 
|  | 365 | "--output $(out)", | 
|  | 366 | visibility: ["//visibility:private"], | 
|  | 367 | } | 
| Motomu Utsumi | 166f966 | 2022-09-01 10:35:29 +0900 | [diff] [blame] | 368 |  | 
|  | 369 | genrule { | 
| Paul Duffin | 5118a52 | 2022-10-05 18:34:24 +0100 | [diff] [blame] | 370 | name: "statslog-connectivity-java-gen", | 
|  | 371 | tools: ["stats-log-api-gen"], | 
|  | 372 | cmd: "$(location stats-log-api-gen) --java $(out) --module connectivity --javaPackage com.android.server --javaClass ConnectivityStatsLog", | 
|  | 373 | out: ["com/android/server/ConnectivityStatsLog.java"], | 
| Motomu Utsumi | 166f966 | 2022-09-01 10:35:29 +0900 | [diff] [blame] | 374 | } |