Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2018 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 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 17 | // The network stack can be compiled using system_current (non-finalized) SDK, or finalized system_X |
| 18 | // SDK. There is also a variant that uses system_current SDK and runs in the system process |
| 19 | // (InProcessNetworkStack). The following structure is used to create the build rules: |
| 20 | // |
| 21 | // NetworkStackAndroidLibraryDefaults <-- common defaults for android libs |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 22 | // / \ |
| 23 | // +NetworkStackApiStableShims --> / \ <-- +NetworkStackApiCurrentShims |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 24 | // +NetworkStackReleaseApiLevel / \ +NetworkStackDevApiLevel |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 25 | // +jarjar apistub.api[latest].* / \ +module src/ |
| 26 | // to apistub.* / \ |
| 27 | // / \ |
| 28 | // NetworkStackApiStableDependencies \ |
| 29 | // / \ android libs w/ all code |
| 30 | // +module src/ --> / \ (also used in unit tests) |
| 31 | // / \ | |
| 32 | // NetworkStackApiStableLib NetworkStackApiCurrentLib <--* |
| 33 | // | | |
| 34 | // | <-- +NetworkStackAppDefaults --> | |
| 35 | // | (APK build params) | |
| 36 | // | | |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 37 | // | <-- +NetworkStackReleaseApiLevel | <-- +NetworkStackDevApiLevel |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 38 | // | | |
| 39 | // | | |
| 40 | // NetworkStackApiStable NetworkStack, InProcessNetworkStack, <-- APKs |
| 41 | // TestNetworkStack |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 42 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 43 | // Common defaults to define SDK level |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 44 | java_defaults { |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 45 | name: "NetworkStackDevApiLevel", |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 46 | sdk_version: "system_current", |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 47 | } |
| 48 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 49 | java_defaults { |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 50 | name: "NetworkStackReleaseApiLevel", |
Remi NGUYEN VAN | 38dc834 | 2020-05-18 18:09:28 +0900 | [diff] [blame] | 51 | sdk_version: "system_30", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 52 | min_sdk_version: "29", |
Remi NGUYEN VAN | 03bcf6c | 2020-05-07 18:53:35 +0900 | [diff] [blame] | 53 | target_sdk_version: "30", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 54 | } |
| 55 | |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 56 | // Filegroups for the API shims |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 57 | filegroup { |
| 58 | name: "NetworkStackApiCurrentShims", |
| 59 | srcs: [ |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 60 | "apishim/common/**/*.java", |
| 61 | "apishim/29/**/*.java", |
Remi NGUYEN VAN | f9c9b71 | 2019-11-08 11:37:33 +0000 | [diff] [blame] | 62 | "apishim/30/**/*.java", |
Remi NGUYEN VAN | 03bcf6c | 2020-05-07 18:53:35 +0900 | [diff] [blame] | 63 | "apishim/31/**/*.java", |
Remi NGUYEN VAN | 44e8ebf | 2020-02-15 04:36:06 +0900 | [diff] [blame] | 64 | ":networkstack-module-utils-srcs", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 65 | ], |
| 66 | } |
| 67 | |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 68 | // API stable shims only include the compat package, but it is jarjared to replace the non-compat |
| 69 | // package |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 70 | filegroup { |
| 71 | name: "NetworkStackApiStableShims", |
| 72 | srcs: [ |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 73 | "apishim/common/**/*.java", |
| 74 | "apishim/29/**/*.java", |
Remi NGUYEN VAN | 03bcf6c | 2020-05-07 18:53:35 +0900 | [diff] [blame] | 75 | "apishim/30/**/*.java", |
Remi NGUYEN VAN | 44e8ebf | 2020-02-15 04:36:06 +0900 | [diff] [blame] | 76 | ":networkstack-module-utils-srcs", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 77 | ], |
| 78 | } |
| 79 | |
| 80 | // Common defaults for android libraries containing network stack code, used to compile variants of |
| 81 | // the network stack in the system process and in the network_stack process |
| 82 | java_defaults { |
| 83 | name: "NetworkStackAndroidLibraryDefaults", |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 84 | srcs: [ |
Remi NGUYEN VAN | 82b4b42 | 2019-01-20 09:35:10 +0900 | [diff] [blame] | 85 | ":framework-networkstack-shared-srcs", |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 86 | ], |
Artur Satayev | 0eb158a | 2019-12-10 12:54:01 +0000 | [diff] [blame] | 87 | libs: ["unsupportedappusage"], |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 88 | static_libs: [ |
Niklas Lindgren | 0c90488 | 2018-12-07 11:08:04 +0100 | [diff] [blame] | 89 | "androidx.annotation_annotation", |
Lorenzo Colitti | ed70006 | 2020-06-10 01:03:55 +0900 | [diff] [blame^] | 90 | "netd_aidl_interface-java", |
Remi NGUYEN VAN | 1fc930c | 2019-08-09 13:23:47 +0900 | [diff] [blame] | 91 | "netlink-client", |
Remi NGUYEN VAN | bbb9703 | 2019-08-08 15:53:54 +0900 | [diff] [blame] | 92 | "networkstack-client", |
Chiachang Wang | 8b5f84a | 2019-02-22 11:13:07 +0800 | [diff] [blame] | 93 | "datastallprotosnano", |
Chiachang Wang | 54663a8 | 2019-03-21 20:40:01 +0800 | [diff] [blame] | 94 | "networkstackprotosnano", |
paulhu | 5982eff | 2019-03-29 19:21:30 +0800 | [diff] [blame] | 95 | "captiveportal-lib", |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 96 | ], |
Kun Niu | f3b6904 | 2019-07-01 17:03:20 -0700 | [diff] [blame] | 97 | plugins: ["java_api_finder"], |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 98 | } |
| 99 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 100 | // The versions of the android library containing network stack code compiled for each SDK variant |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 101 | // API current uses the sources of the API current shims directly. |
| 102 | // This allows API current code to be treated identically to code in src/ (it will be moved |
| 103 | // there eventually), and to use the compat shim as fallback on older devices. |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 104 | android_library { |
| 105 | name: "NetworkStackApiCurrentLib", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 106 | defaults: ["NetworkStackDevApiLevel", "NetworkStackAndroidLibraryDefaults"], |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 107 | srcs: [ |
| 108 | ":NetworkStackApiCurrentShims", |
| 109 | "src/**/*.java", |
| 110 | ":statslog-networkstack-java-gen" |
| 111 | ], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 112 | manifest: "AndroidManifestBase.xml", |
| 113 | } |
| 114 | |
| 115 | // For API stable, first build the dependencies using jarjar compat rules, then build the sources |
| 116 | // linking with the dependencies. |
| 117 | java_library { |
| 118 | name: "NetworkStackApiStableDependencies", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 119 | defaults: ["NetworkStackReleaseApiLevel", "NetworkStackAndroidLibraryDefaults"], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 120 | srcs: [":NetworkStackApiStableShims"], |
| 121 | jarjar_rules: "apishim/jarjar-rules-compat.txt", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | android_library { |
| 125 | name: "NetworkStackApiStableLib", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 126 | defaults: ["NetworkStackReleaseApiLevel"], |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 127 | srcs: [ |
| 128 | "src/**/*.java", |
| 129 | ":statslog-networkstack-java-gen-q", |
| 130 | ], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 131 | // API stable uses a jarjared version of the shims |
| 132 | static_libs: [ |
| 133 | "NetworkStackApiStableDependencies", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 134 | ], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 135 | manifest: "AndroidManifestBase.xml", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 136 | } |
| 137 | |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 138 | filegroup { |
| 139 | name: "NetworkStackJarJarRules", |
| 140 | srcs: ["jarjar-rules-shared.txt"], |
| 141 | visibility: [ |
| 142 | "//packages/modules/NetworkStack/tests/unit", |
| 143 | "//packages/modules/NetworkStack/tests/integration", |
Paul Hu | c031240 | 2020-04-10 09:59:48 +0000 | [diff] [blame] | 144 | "//frameworks/base/packages/Tethering/tests/integration", |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 145 | ] |
| 146 | } |
| 147 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 148 | // Common defaults for compiling the actual APK, based on the NetworkStackApiXBase android libraries |
| 149 | java_defaults { |
| 150 | name: "NetworkStackAppDefaults", |
| 151 | privileged: true, |
| 152 | jni_libs: [ |
| 153 | "libnativehelper_compat_libc++", |
| 154 | "libnetworkstackutilsjni", |
| 155 | ], |
| 156 | // Resources already included in NetworkStackBase |
| 157 | resource_dirs: [], |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 158 | jarjar_rules: ":NetworkStackJarJarRules", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 159 | use_embedded_native_libs: true, |
| 160 | optimize: { |
| 161 | proguard_flags_files: ["proguard.flags"], |
| 162 | }, |
| 163 | } |
| 164 | |
| 165 | // Non-updatable network stack running in the system server process for devices not using the module |
| 166 | android_app { |
| 167 | name: "InProcessNetworkStack", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 168 | defaults: [ "NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 169 | static_libs: ["NetworkStackApiCurrentLib"], |
| 170 | certificate: "platform", |
| 171 | manifest: "AndroidManifest_InProcess.xml", |
| 172 | // InProcessNetworkStack is a replacement for NetworkStack |
Remi NGUYEN VAN | ec9d8a6 | 2019-11-11 03:52:43 +0000 | [diff] [blame] | 173 | overrides: ["NetworkStack", "NetworkStackNext"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 174 | // The permission configuration *must* be included to ensure security of the device |
| 175 | // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces |
| 176 | // the default CaptivePortalLogin. |
| 177 | required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"], |
| 178 | } |
| 179 | |
Remi NGUYEN VAN | 255d491 | 2020-02-05 13:42:45 +0900 | [diff] [blame] | 180 | // Pre-merge the AndroidManifest for NetworkStackNext, so that its manifest can be merged on top |
| 181 | android_library { |
| 182 | name: "NetworkStackNextManifestBase", |
| 183 | defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
| 184 | static_libs: ["NetworkStackApiCurrentLib"], |
| 185 | manifest: "AndroidManifest.xml" |
| 186 | } |
| 187 | |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 188 | // NetworkStack build targeting the current API release, for testing on in-development SDK |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 189 | android_app { |
Remi NGUYEN VAN | ec9d8a6 | 2019-11-11 03:52:43 +0000 | [diff] [blame] | 190 | name: "NetworkStackNext", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 191 | defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
Remi NGUYEN VAN | 255d491 | 2020-02-05 13:42:45 +0900 | [diff] [blame] | 192 | static_libs: ["NetworkStackNextManifestBase"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 193 | certificate: "networkstack", |
Remi NGUYEN VAN | 255d491 | 2020-02-05 13:42:45 +0900 | [diff] [blame] | 194 | manifest: "AndroidManifest_Next.xml", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 195 | // The permission configuration *must* be included to ensure security of the device |
| 196 | required: ["NetworkPermissionConfig"], |
| 197 | } |
| 198 | |
| 199 | // Updatable network stack for finalized API |
| 200 | android_app { |
Remi NGUYEN VAN | ec9d8a6 | 2019-11-11 03:52:43 +0000 | [diff] [blame] | 201 | name: "NetworkStack", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 202 | defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 203 | static_libs: ["NetworkStackApiStableLib"], |
| 204 | certificate: "networkstack", |
| 205 | manifest: "AndroidManifest.xml", |
| 206 | // The permission configuration *must* be included to ensure security of the device |
| 207 | required: ["NetworkPermissionConfig"], |
Artur Satayev | 66780a8 | 2020-04-09 11:35:52 +0100 | [diff] [blame] | 208 | updatable: true, |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | // Android library to derive test APKs for integration tests |
| 212 | android_library { |
| 213 | name: "TestNetworkStackLib", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 214 | defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"], |
| 215 | static_libs: ["NetworkStackApiStableLib"], |
Remi NGUYEN VAN | ae18aed | 2019-10-30 18:20:36 +0900 | [diff] [blame] | 216 | manifest: "AndroidManifestBase.xml", |
Remi NGUYEN VAN | 252c6f2 | 2020-05-25 18:27:59 +0900 | [diff] [blame] | 217 | visibility: [ |
| 218 | "//frameworks/base/tests/net/integration", |
| 219 | "//cts/tests/tests/net", |
| 220 | ], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 221 | } |
| 222 | |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 223 | cc_library_shared { |
| 224 | name: "libnetworkstackutilsjni", |
| 225 | srcs: [ |
| 226 | "jni/network_stack_utils_jni.cpp" |
| 227 | ], |
Jooyung Han | 9b1bf05 | 2020-04-29 02:43:03 +0900 | [diff] [blame] | 228 | sdk_version: "29", |
| 229 | min_sdk_version: "29", |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 230 | shared_libs: [ |
| 231 | "liblog", |
Lorenzo Colitti | 88ddd88 | 2019-05-01 11:54:33 +0900 | [diff] [blame] | 232 | "libnativehelper_compat_libc++", |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 233 | ], |
Lorenzo Colitti | 88ddd88 | 2019-05-01 11:54:33 +0900 | [diff] [blame] | 234 | |
| 235 | // We cannot use plain "libc++" here to link libc++ dynamically because it results in: |
| 236 | // java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found |
| 237 | // even if "libc++" is added into jni_libs below. Adding "libc++_shared" into jni_libs doesn't |
| 238 | // build because soong complains of: |
| 239 | // module NetworkStack missing dependencies: libc++_shared |
| 240 | // |
| 241 | // So, link libc++ statically. This means that we also need to ensure that all the C++ libraries |
| 242 | // we depend on do not dynamically link libc++. This is currently the case, because liblog is |
| 243 | // C-only and libnativehelper_compat_libc also uses stl: "c++_static". |
| 244 | // |
| 245 | // TODO: find a better solution for this in R. |
| 246 | stl: "c++_static", |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 247 | cflags: [ |
| 248 | "-Wall", |
| 249 | "-Werror", |
| 250 | "-Wno-unused-parameter", |
| 251 | ], |
| 252 | } |
| 253 | |
Chiachang Wang | 8024227 | 2019-04-11 21:24:28 +0800 | [diff] [blame] | 254 | genrule { |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 255 | name: "statslog-networkstack-java-gen-q", |
| 256 | tools: ["stats-log-api-gen"], |
| 257 | cmd: "$(location stats-log-api-gen) --java $(out) --module network_stack" + |
| 258 | " --javaPackage com.android.networkstack.metrics --javaClass NetworkStackStatsLog" + |
| 259 | " --compileQ", |
| 260 | out: ["com/android/networkstack/metrics/NetworkStackStatsLog.java"], |
| 261 | } |
| 262 | |
| 263 | genrule { |
Chiachang Wang | 8024227 | 2019-04-11 21:24:28 +0800 | [diff] [blame] | 264 | name: "statslog-networkstack-java-gen", |
| 265 | tools: ["stats-log-api-gen"], |
| 266 | cmd: "$(location stats-log-api-gen) --java $(out) --module network_stack" + |
Muhammad Qureshi | 8e0e9bc | 2019-12-31 11:26:33 -0800 | [diff] [blame] | 267 | " --javaPackage com.android.networkstack.metrics --javaClass NetworkStackStatsLog" + |
| 268 | " --supportQ", |
Chiachang Wang | 8024227 | 2019-04-11 21:24:28 +0800 | [diff] [blame] | 269 | out: ["com/android/networkstack/metrics/NetworkStackStatsLog.java"], |
| 270 | } |
Kun Niu | 8e89dd4 | 2019-07-16 18:33:45 -0700 | [diff] [blame] | 271 | |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 272 | version_code_networkstack_next = "300000000" |
| 273 | version_code_networkstack_test = "999999999" |
| 274 | |
Kun Niu | 8e89dd4 | 2019-07-16 18:33:45 -0700 | [diff] [blame] | 275 | genrule { |
| 276 | name: "NetworkStackTestAndroidManifest", |
| 277 | srcs: ["AndroidManifest.xml"], |
| 278 | out: ["TestAndroidManifest.xml"], |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 279 | cmd: "sed -E 's/versionCode=\"[0-9]+\"/versionCode=\"" |
| 280 | + version_code_networkstack_test |
| 281 | + "\"/' $(in) > $(out)", |
| 282 | visibility: ["//visibility:private"], |
| 283 | } |
| 284 | |
Kun Niu | 8e89dd4 | 2019-07-16 18:33:45 -0700 | [diff] [blame] | 285 | android_app { |
| 286 | name: "TestNetworkStack", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 287 | defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 288 | static_libs: ["NetworkStackApiCurrentLib"], |
Kun Niu | 8e89dd4 | 2019-07-16 18:33:45 -0700 | [diff] [blame] | 289 | certificate: "networkstack", |
| 290 | manifest: ":NetworkStackTestAndroidManifest", |
Kun Niu | 8e89dd4 | 2019-07-16 18:33:45 -0700 | [diff] [blame] | 291 | // The permission configuration *must* be included to ensure security of the device |
| 292 | required: ["NetworkPermissionConfig"], |
| 293 | } |