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