| Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +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 | 727b672 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 17 | package { | 
|  | 18 | // See: http://go/android-license-faq | 
| Baligh Uddin | 2afd098 | 2021-05-24 03:50:01 +0000 | [diff] [blame] | 19 | default_applicable_licenses: ["Android-Apache-2.0"], | 
| Bob Badour | 727b672 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 20 | } | 
|  | 21 |  | 
| Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 22 | filegroup { | 
| Remi NGUYEN VAN | ad43ca6 | 2021-02-15 20:16:28 +0900 | [diff] [blame] | 23 | name: "framework-connectivity-internal-sources", | 
| Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 24 | srcs: [ | 
|  | 25 | "src/**/*.java", | 
|  | 26 | "src/**/*.aidl", | 
|  | 27 | ], | 
|  | 28 | path: "src", | 
|  | 29 | visibility: [ | 
| Remi NGUYEN VAN | ad43ca6 | 2021-02-15 20:16:28 +0900 | [diff] [blame] | 30 | "//visibility:private", | 
|  | 31 | ], | 
|  | 32 | } | 
|  | 33 |  | 
|  | 34 | filegroup { | 
|  | 35 | name: "framework-connectivity-aidl-export-sources", | 
|  | 36 | srcs: [ | 
|  | 37 | "aidl-export/**/*.aidl", | 
|  | 38 | ], | 
|  | 39 | path: "aidl-export", | 
|  | 40 | visibility: [ | 
|  | 41 | "//visibility:private", | 
|  | 42 | ], | 
|  | 43 | } | 
|  | 44 |  | 
|  | 45 | // TODO: use a java_library in the bootclasspath instead | 
|  | 46 | filegroup { | 
|  | 47 | name: "framework-connectivity-sources", | 
|  | 48 | srcs: [ | 
|  | 49 | ":framework-connectivity-internal-sources", | 
|  | 50 | ":framework-connectivity-aidl-export-sources", | 
|  | 51 | ], | 
|  | 52 | visibility: [ | 
| Remi NGUYEN VAN | 66ea68e | 2021-01-15 16:22:36 +0900 | [diff] [blame] | 53 | "//frameworks/base", | 
|  | 54 | "//packages/modules/Connectivity:__subpackages__", | 
|  | 55 | ], | 
| Bob Badour | 727b672 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 56 | } | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 57 |  | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 58 | java_defaults { | 
|  | 59 | name: "framework-connectivity-defaults", | 
|  | 60 | defaults: ["framework-module-defaults"], | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 61 | sdk_version: "module_current", | 
|  | 62 | min_sdk_version: "30", | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 63 | srcs: [ | 
|  | 64 | ":framework-connectivity-sources", | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 65 | ":net-utils-framework-common-srcs", | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 66 | ":framework-connectivity-api-shared-srcs", | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 67 | ], | 
|  | 68 | aidl: { | 
| Siim Sammul | cd4c822 | 2021-12-13 15:52:07 +0000 | [diff] [blame] | 69 | generate_get_transaction_name: true, | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 70 | include_dirs: [ | 
|  | 71 | // Include directories for parcelables that are part of the stable API, and need a | 
|  | 72 | // one-line "parcelable X" .aidl declaration to be used in AIDL interfaces. | 
|  | 73 | // TODO(b/180293679): remove these dependencies as they should not be necessary once | 
|  | 74 | // the module builds against API (the parcelable declarations exist in framework.aidl) | 
|  | 75 | "frameworks/base/core/java", // For framework parcelables | 
|  | 76 | "frameworks/native/aidl/binder", // For PersistableBundle.aidl | 
|  | 77 | ], | 
|  | 78 | }, | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 79 | stub_only_libs: [ | 
| paulhu | 537f720 | 2022-02-08 21:25:28 +0800 | [diff] [blame] | 80 | "framework-connectivity-t.stubs.module_lib", | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 81 | ], | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 82 | impl_only_libs: [ | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 83 | "framework-tethering.stubs.module_lib", | 
|  | 84 | "framework-wifi.stubs.module_lib", | 
|  | 85 | "net-utils-device-common", | 
|  | 86 | ], | 
| Chalard Jean | dece0d8 | 2021-11-15 18:17:33 +0900 | [diff] [blame] | 87 | static_libs: [ | 
| paulhu | 541b72d | 2022-02-09 14:02:43 +0800 | [diff] [blame] | 88 | "mdns_aidl_interface-lateststable-java", | 
| Xiao Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 89 | "modules-utils-backgroundthread", | 
| Chalard Jean | dece0d8 | 2021-11-15 18:17:33 +0900 | [diff] [blame] | 90 | "modules-utils-build", | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 91 | "modules-utils-preconditions", | 
| Vinh Tran | 6d8c1d7 | 2022-06-08 01:25:14 -0400 | [diff] [blame] | 92 | "framework-connectivity-javastream-protos", | 
| Chalard Jean | dece0d8 | 2021-11-15 18:17:33 +0900 | [diff] [blame] | 93 | ], | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 94 | libs: [ | 
| Jooyung Han | c837554 | 2022-06-24 19:16:40 +0900 | [diff] [blame] | 95 | "androidx.annotation_annotation", | 
| Taras Antoshchuk | 30d41e5 | 2021-08-02 18:06:35 +0200 | [diff] [blame] | 96 | "app-compat-annotations", | 
| paulhu | 537f720 | 2022-02-08 21:25:28 +0800 | [diff] [blame] | 97 | "framework-connectivity-t.stubs.module_lib", | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 98 | "unsupportedappusage", | 
|  | 99 | ], | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 100 | apex_available: [ | 
|  | 101 | "com.android.tethering", | 
|  | 102 | ], | 
|  | 103 | lint: { strict_updatability_linting: true }, | 
|  | 104 | } | 
|  | 105 |  | 
|  | 106 | java_library { | 
|  | 107 | name: "framework-connectivity-pre-jarjar", | 
|  | 108 | defaults: ["framework-connectivity-defaults"], | 
|  | 109 | libs: [ | 
|  | 110 | // This cannot be in the defaults clause above because if it were, it would be used | 
|  | 111 | // to generate the connectivity stubs. That would create a circular dependency | 
|  | 112 | // because the tethering stubs depend on the connectivity stubs (e.g., | 
|  | 113 | // TetheringRequest depends on LinkAddress). | 
|  | 114 | "framework-tethering.stubs.module_lib", | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 115 | "framework-wifi.stubs.module_lib", | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 116 | ], | 
|  | 117 | visibility: ["//packages/modules/Connectivity:__subpackages__"] | 
|  | 118 | } | 
|  | 119 |  | 
|  | 120 | java_sdk_library { | 
|  | 121 | name: "framework-connectivity", | 
|  | 122 | defaults: ["framework-connectivity-defaults"], | 
|  | 123 | installable: true, | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 124 | jarjar_rules: ":framework-connectivity-jarjar-rules", | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 125 | permitted_packages: ["android.net"], | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 126 | impl_library_visibility: [ | 
|  | 127 | "//packages/modules/Connectivity/Tethering/apex", | 
|  | 128 | // In preparation for future move | 
|  | 129 | "//packages/modules/Connectivity/apex", | 
| Remi NGUYEN VAN | 6a20eed | 2022-01-31 11:21:08 +0900 | [diff] [blame] | 130 | "//packages/modules/Connectivity/framework-t", | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 131 | "//packages/modules/Connectivity/service", | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 132 | "//packages/modules/Connectivity/service-t", | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 133 | "//frameworks/base/packages/Connectivity/service", | 
|  | 134 | "//frameworks/base", | 
| Remi NGUYEN VAN | 173f8b1 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 135 |  | 
|  | 136 | // Tests using hidden APIs | 
| Chiachang Wang | 3270871 | 2021-04-14 11:48:19 +0800 | [diff] [blame] | 137 | "//cts/tests/netlegacy22.api", | 
| Lorenzo Colitti | eb8d855 | 2022-02-01 13:51:42 +0900 | [diff] [blame] | 138 | "//cts/tests/tests/app.usage", // NetworkUsageStatsTest | 
| Remi NGUYEN VAN | 173f8b1 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 139 | "//external/sl4a:__subpackages__", | 
| Remi NGUYEN VAN | 678277c | 2021-05-11 13:37:06 +0000 | [diff] [blame] | 140 | "//frameworks/base/packages/Connectivity/tests:__subpackages__", | 
| Remi NGUYEN VAN | 85a4e07 | 2022-02-02 20:06:56 +0900 | [diff] [blame] | 141 | "//frameworks/base/core/tests/bandwidthtests", | 
|  | 142 | "//frameworks/base/core/tests/benchmarks", | 
|  | 143 | "//frameworks/base/core/tests/utillib", | 
| Aaron Huang | 720ad7c | 2022-01-26 00:43:10 +0800 | [diff] [blame] | 144 | "//frameworks/base/tests/vcn", | 
| Remi NGUYEN VAN | 173f8b1 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 145 | "//frameworks/libs/net/common/testutils", | 
|  | 146 | "//frameworks/libs/net/common/tests:__subpackages__", | 
| Xiao Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 147 | "//frameworks/opt/net/ethernet/tests:__subpackages__", | 
| Remi NGUYEN VAN | 173f8b1 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 148 | "//frameworks/opt/telephony/tests/telephonytests", | 
| Chiachang Wang | 426a6de | 2021-04-13 11:15:36 +0800 | [diff] [blame] | 149 | "//packages/modules/CaptivePortalLogin/tests", | 
| Remi NGUYEN VAN | 173f8b1 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 150 | "//packages/modules/Connectivity/Tethering/tests:__subpackages__", | 
|  | 151 | "//packages/modules/Connectivity/tests:__subpackages__", | 
| Aaron Huang | 720ad7c | 2022-01-26 00:43:10 +0800 | [diff] [blame] | 152 | "//packages/modules/IPsec/tests/iketests", | 
| Remi NGUYEN VAN | 173f8b1 | 2021-03-16 01:31:07 +0000 | [diff] [blame] | 153 | "//packages/modules/NetworkStack/tests:__subpackages__", | 
| Chiachang Wang | e9d848e | 2021-03-31 16:11:37 +0800 | [diff] [blame] | 154 | "//packages/modules/Wifi/service/tests/wifitests", | 
| Remi NGUYEN VAN | 71d64e7 | 2021-03-24 22:59:50 +0900 | [diff] [blame] | 155 | ], | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 156 | } | 
|  | 157 |  | 
| Taras Antoshchuk | 30d41e5 | 2021-08-02 18:06:35 +0200 | [diff] [blame] | 158 | platform_compat_config { | 
|  | 159 | name: "connectivity-platform-compat-config", | 
|  | 160 | src: ":framework-connectivity", | 
|  | 161 | } | 
|  | 162 |  | 
| Remi NGUYEN VAN | deed4cb | 2021-04-02 06:38:46 +0000 | [diff] [blame] | 163 | cc_library_shared { | 
|  | 164 | name: "libframework-connectivity-jni", | 
|  | 165 | min_sdk_version: "30", | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 166 | cflags: [ | 
|  | 167 | "-Wall", | 
|  | 168 | "-Werror", | 
|  | 169 | "-Wno-unused-parameter", | 
| Remi NGUYEN VAN | b36fb99 | 2021-03-23 14:45:58 +0000 | [diff] [blame] | 170 | // Don't warn about S API usage even with | 
|  | 171 | // min_sdk 30: the library is only loaded | 
|  | 172 | // on S+ devices | 
|  | 173 | "-Wno-unguarded-availability", | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 174 | "-Wthread-safety", | 
|  | 175 | ], | 
| Remi NGUYEN VAN | deed4cb | 2021-04-02 06:38:46 +0000 | [diff] [blame] | 176 | srcs: [ | 
|  | 177 | "jni/android_net_NetworkUtils.cpp", | 
|  | 178 | "jni/onload.cpp", | 
|  | 179 | ], | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 180 | shared_libs: [ | 
| Remi NGUYEN VAN | deed4cb | 2021-04-02 06:38:46 +0000 | [diff] [blame] | 181 | "libandroid", | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 182 | "liblog", | 
|  | 183 | "libnativehelper", | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 184 | ], | 
|  | 185 | header_libs: [ | 
|  | 186 | "dnsproxyd_protocol_headers", | 
|  | 187 | ], | 
| Remi NGUYEN VAN | deed4cb | 2021-04-02 06:38:46 +0000 | [diff] [blame] | 188 | stl: "none", | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 189 | apex_available: [ | 
| Remi NGUYEN VAN | c58c993 | 2021-03-19 10:13:40 +0000 | [diff] [blame] | 190 | "com.android.tethering", | 
| Remi NGUYEN VAN | 3b52af9 | 2021-03-19 00:24:45 +0000 | [diff] [blame] | 191 | ], | 
| Remi NGUYEN VAN | 11b5a5c | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 192 | } | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 193 |  | 
| Aaron Huang | dac7e4b | 2022-02-14 21:38:14 +0800 | [diff] [blame] | 194 | filegroup { | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 195 | name: "framework-connectivity-protos", | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 196 | srcs: [ | 
| Aaron Huang | dac7e4b | 2022-02-14 21:38:14 +0800 | [diff] [blame] | 197 | "proto/**/*.proto", | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 198 | ], | 
| Aaron Huang | dac7e4b | 2022-02-14 21:38:14 +0800 | [diff] [blame] | 199 | visibility: ["//frameworks/base"], | 
|  | 200 | } | 
|  | 201 |  | 
| Vinh Tran | 6d8c1d7 | 2022-06-08 01:25:14 -0400 | [diff] [blame] | 202 | java_library { | 
| Aaron Huang | dac7e4b | 2022-02-14 21:38:14 +0800 | [diff] [blame] | 203 | name: "framework-connectivity-javastream-protos", | 
| Vinh Tran | 6d8c1d7 | 2022-06-08 01:25:14 -0400 | [diff] [blame] | 204 | proto: { | 
|  | 205 | type: "stream", | 
|  | 206 | }, | 
|  | 207 | srcs: [":framework-connectivity-protos"], | 
|  | 208 | installable: false, | 
|  | 209 | sdk_version: "module_current", | 
|  | 210 | min_sdk_version: "30", | 
|  | 211 | apex_available: [ | 
|  | 212 | "com.android.tethering", | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 213 | ], | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 214 | } | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 215 |  | 
|  | 216 | java_genrule { | 
|  | 217 | name: "framework-connectivity-jarjar-rules", | 
|  | 218 | tool_files: [ | 
|  | 219 | ":connectivity-hiddenapi-files", | 
|  | 220 | ":framework-connectivity-pre-jarjar{.jar}", | 
|  | 221 | ":framework-connectivity-t-pre-jarjar{.jar}", | 
|  | 222 | ":framework-connectivity.stubs.module_lib{.jar}", | 
|  | 223 | ":framework-connectivity-t.stubs.module_lib{.jar}", | 
|  | 224 | "jarjar-excludes.txt", | 
|  | 225 | ], | 
|  | 226 | tools: [ | 
|  | 227 | "jarjar-rules-generator", | 
|  | 228 | ], | 
|  | 229 | out: ["framework_connectivity_jarjar_rules.txt"], | 
|  | 230 | cmd: "$(location jarjar-rules-generator) " + | 
| Remi NGUYEN VAN | 0bd90f1 | 2022-08-10 20:15:46 +0900 | [diff] [blame] | 231 | "$(location :framework-connectivity-pre-jarjar{.jar}) " + | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 232 | "$(location :framework-connectivity-t-pre-jarjar{.jar}) " + | 
|  | 233 | "--prefix android.net.connectivity " + | 
|  | 234 | "--apistubs $(location :framework-connectivity.stubs.module_lib{.jar}) " + | 
| Remi NGUYEN VAN | 0bd90f1 | 2022-08-10 20:15:46 +0900 | [diff] [blame] | 235 | "--apistubs $(location :framework-connectivity-t.stubs.module_lib{.jar}) " + | 
|  | 236 | // Make a ":"-separated list. There will be an extra ":" but empty items are ignored. | 
|  | 237 | "--unsupportedapi $$(printf ':%s' $(locations :connectivity-hiddenapi-files)) " + | 
| Remi NGUYEN VAN | e55a88d | 2022-04-20 15:59:16 +0900 | [diff] [blame] | 238 | "--excludes $(location jarjar-excludes.txt) " + | 
|  | 239 | "--output $(out)", | 
|  | 240 | visibility: [ | 
|  | 241 | "//packages/modules/Connectivity/framework:__subpackages__", | 
|  | 242 | "//packages/modules/Connectivity/framework-t:__subpackages__", | 
|  | 243 | "//packages/modules/Connectivity/service", | 
|  | 244 | ], | 
|  | 245 | } |