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 | 5b3ea2f | 2020-11-24 02:43:44 +0000 | [diff] [blame] | 46 | min_sdk_version: "29", |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 47 | sdk_version: "system_current", |
Remi NGUYEN VAN | 4036956 | 2019-03-20 16:40:54 +0900 | [diff] [blame] | 48 | } |
| 49 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 50 | java_defaults { |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 51 | name: "NetworkStackReleaseApiLevel", |
Remi NGUYEN VAN | 38dc834 | 2020-05-18 18:09:28 +0900 | [diff] [blame] | 52 | sdk_version: "system_30", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 53 | min_sdk_version: "29", |
Remi NGUYEN VAN | 03bcf6c | 2020-05-07 18:53:35 +0900 | [diff] [blame] | 54 | target_sdk_version: "30", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 55 | } |
| 56 | |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 57 | // Filegroups for the API shims |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 58 | filegroup { |
| 59 | name: "NetworkStackApiCurrentShims", |
| 60 | srcs: [ |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 61 | "apishim/common/**/*.java", |
| 62 | "apishim/29/**/*.java", |
Remi NGUYEN VAN | f9c9b71 | 2019-11-08 11:37:33 +0000 | [diff] [blame] | 63 | "apishim/30/**/*.java", |
Remi NGUYEN VAN | 03bcf6c | 2020-05-07 18:53:35 +0900 | [diff] [blame] | 64 | "apishim/31/**/*.java", |
Remi NGUYEN VAN | 44e8ebf | 2020-02-15 04:36:06 +0900 | [diff] [blame] | 65 | ":networkstack-module-utils-srcs", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 66 | ], |
| 67 | } |
| 68 | |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 69 | // API stable shims only include the compat package, but it is jarjared to replace the non-compat |
| 70 | // package |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 71 | filegroup { |
| 72 | name: "NetworkStackApiStableShims", |
| 73 | srcs: [ |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 74 | "apishim/common/**/*.java", |
| 75 | "apishim/29/**/*.java", |
Remi NGUYEN VAN | 03bcf6c | 2020-05-07 18:53:35 +0900 | [diff] [blame] | 76 | "apishim/30/**/*.java", |
Remi NGUYEN VAN | 44e8ebf | 2020-02-15 04:36:06 +0900 | [diff] [blame] | 77 | ":networkstack-module-utils-srcs", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 78 | ], |
| 79 | } |
| 80 | |
| 81 | // Common defaults for android libraries containing network stack code, used to compile variants of |
| 82 | // the network stack in the system process and in the network_stack process |
| 83 | java_defaults { |
| 84 | name: "NetworkStackAndroidLibraryDefaults", |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 85 | srcs: [ |
Remi NGUYEN VAN | 82b4b42 | 2019-01-20 09:35:10 +0900 | [diff] [blame] | 86 | ":framework-networkstack-shared-srcs", |
Remi NGUYEN VAN | ded2315 | 2018-12-07 16:52:24 +0900 | [diff] [blame] | 87 | ], |
Artur Satayev | 0eb158a | 2019-12-10 12:54:01 +0000 | [diff] [blame] | 88 | libs: ["unsupportedappusage"], |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 89 | static_libs: [ |
Niklas Lindgren | 0c90488 | 2018-12-07 11:08:04 +0100 | [diff] [blame] | 90 | "androidx.annotation_annotation", |
Remi NGUYEN VAN | f7bef39 | 2020-08-26 21:48:20 +0900 | [diff] [blame] | 91 | "netd_aidl_interface-java", |
Remi NGUYEN VAN | 1fc930c | 2019-08-09 13:23:47 +0900 | [diff] [blame] | 92 | "netlink-client", |
Remi NGUYEN VAN | bbb9703 | 2019-08-08 15:53:54 +0900 | [diff] [blame] | 93 | "networkstack-client", |
Remi NGUYEN VAN | c628adc | 2020-06-08 15:34:22 +0900 | [diff] [blame] | 94 | "net-utils-framework-common", |
Remi NGUYEN VAN | e7c00c4 | 2020-06-22 18:50:20 +0900 | [diff] [blame] | 95 | // See note on statsprotos when adding/updating proto build rules |
Chiachang Wang | 8b5f84a | 2019-02-22 11:13:07 +0800 | [diff] [blame] | 96 | "datastallprotosnano", |
lifr | 1995d8e | 2020-05-21 20:32:36 +0800 | [diff] [blame] | 97 | "statsprotos", |
paulhu | 5982eff | 2019-03-29 19:21:30 +0800 | [diff] [blame] | 98 | "captiveportal-lib", |
Chalard Jean | 6f67521 | 2020-06-25 23:41:16 +0900 | [diff] [blame] | 99 | "net-utils-device-common", |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 100 | ], |
Kun Niu | f3b6904 | 2019-07-01 17:03:20 -0700 | [diff] [blame] | 101 | plugins: ["java_api_finder"], |
Remi NGUYEN VAN | 0a4df5a | 2019-03-08 17:20:49 +0900 | [diff] [blame] | 102 | } |
| 103 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 104 | // 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] | 105 | // API current uses the sources of the API current shims directly. |
| 106 | // This allows API current code to be treated identically to code in src/ (it will be moved |
| 107 | // 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] | 108 | android_library { |
| 109 | name: "NetworkStackApiCurrentLib", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 110 | defaults: ["NetworkStackDevApiLevel", "NetworkStackAndroidLibraryDefaults"], |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 111 | srcs: [ |
| 112 | ":NetworkStackApiCurrentShims", |
| 113 | "src/**/*.java", |
Remi NGUYEN VAN | da5f6bb | 2021-02-09 08:08:38 +0000 | [diff] [blame] | 114 | ":statslog-networkstack-java-gen" |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 115 | ], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 116 | manifest: "AndroidManifestBase.xml", |
| 117 | } |
| 118 | |
| 119 | // For API stable, first build the dependencies using jarjar compat rules, then build the sources |
| 120 | // linking with the dependencies. |
| 121 | java_library { |
| 122 | name: "NetworkStackApiStableDependencies", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 123 | defaults: ["NetworkStackReleaseApiLevel", "NetworkStackAndroidLibraryDefaults"], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 124 | srcs: [":NetworkStackApiStableShims"], |
| 125 | jarjar_rules: "apishim/jarjar-rules-compat.txt", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | android_library { |
| 129 | name: "NetworkStackApiStableLib", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 130 | defaults: ["NetworkStackReleaseApiLevel"], |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 131 | srcs: [ |
| 132 | "src/**/*.java", |
Remi NGUYEN VAN | da5f6bb | 2021-02-09 08:08:38 +0000 | [diff] [blame] | 133 | ":statslog-networkstack-java-gen", |
Muhammad Qureshi | aa428cc | 2020-01-29 11:15:16 -0800 | [diff] [blame] | 134 | ], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 135 | // API stable uses a jarjared version of the shims |
| 136 | static_libs: [ |
| 137 | "NetworkStackApiStableDependencies", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 138 | ], |
Remi NGUYEN VAN | 794a4b5 | 2019-09-06 13:00:33 +0900 | [diff] [blame] | 139 | manifest: "AndroidManifestBase.xml", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 140 | } |
| 141 | |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 142 | filegroup { |
| 143 | name: "NetworkStackJarJarRules", |
| 144 | srcs: ["jarjar-rules-shared.txt"], |
| 145 | visibility: [ |
| 146 | "//packages/modules/NetworkStack/tests/unit", |
| 147 | "//packages/modules/NetworkStack/tests/integration", |
Paul Hu | c031240 | 2020-04-10 09:59:48 +0000 | [diff] [blame] | 148 | "//frameworks/base/packages/Tethering/tests/integration", |
Baligh Uddin | 1151e2e | 2020-10-29 02:12:29 +0000 | [diff] [blame] | 149 | "//packages/modules/Connectivity/Tethering/tests/integration", |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 150 | ] |
| 151 | } |
| 152 | |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 153 | // Common defaults for compiling the actual APK, based on the NetworkStackApiXBase android libraries |
| 154 | java_defaults { |
| 155 | name: "NetworkStackAppDefaults", |
| 156 | privileged: true, |
| 157 | jni_libs: [ |
| 158 | "libnativehelper_compat_libc++", |
| 159 | "libnetworkstackutilsjni", |
| 160 | ], |
| 161 | // Resources already included in NetworkStackBase |
| 162 | resource_dirs: [], |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 163 | jarjar_rules: ":NetworkStackJarJarRules", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 164 | use_embedded_native_libs: true, |
| 165 | optimize: { |
| 166 | proguard_flags_files: ["proguard.flags"], |
| 167 | }, |
| 168 | } |
| 169 | |
| 170 | // Non-updatable network stack running in the system server process for devices not using the module |
| 171 | android_app { |
| 172 | name: "InProcessNetworkStack", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 173 | defaults: [ "NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 174 | static_libs: ["NetworkStackApiCurrentLib"], |
| 175 | certificate: "platform", |
| 176 | manifest: "AndroidManifest_InProcess.xml", |
| 177 | // InProcessNetworkStack is a replacement for NetworkStack |
Remi NGUYEN VAN | ec9d8a6 | 2019-11-11 03:52:43 +0000 | [diff] [blame] | 178 | overrides: ["NetworkStack", "NetworkStackNext"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 179 | // The permission configuration *must* be included to ensure security of the device |
| 180 | // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces |
| 181 | // the default CaptivePortalLogin. |
| 182 | required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"], |
| 183 | } |
| 184 | |
Remi NGUYEN VAN | 255d491 | 2020-02-05 13:42:45 +0900 | [diff] [blame] | 185 | // Pre-merge the AndroidManifest for NetworkStackNext, so that its manifest can be merged on top |
| 186 | android_library { |
| 187 | name: "NetworkStackNextManifestBase", |
| 188 | defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
| 189 | static_libs: ["NetworkStackApiCurrentLib"], |
| 190 | manifest: "AndroidManifest.xml" |
| 191 | } |
| 192 | |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 193 | // 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] | 194 | android_app { |
Remi NGUYEN VAN | ec9d8a6 | 2019-11-11 03:52:43 +0000 | [diff] [blame] | 195 | name: "NetworkStackNext", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 196 | defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |
Remi NGUYEN VAN | 255d491 | 2020-02-05 13:42:45 +0900 | [diff] [blame] | 197 | static_libs: ["NetworkStackNextManifestBase"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 198 | certificate: "networkstack", |
Remi NGUYEN VAN | 255d491 | 2020-02-05 13:42:45 +0900 | [diff] [blame] | 199 | manifest: "AndroidManifest_Next.xml", |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 200 | // The permission configuration *must* be included to ensure security of the device |
| 201 | required: ["NetworkPermissionConfig"], |
| 202 | } |
| 203 | |
| 204 | // Updatable network stack for finalized API |
| 205 | android_app { |
Remi NGUYEN VAN | ec9d8a6 | 2019-11-11 03:52:43 +0000 | [diff] [blame] | 206 | name: "NetworkStack", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 207 | defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 208 | static_libs: ["NetworkStackApiStableLib"], |
| 209 | certificate: "networkstack", |
| 210 | manifest: "AndroidManifest.xml", |
| 211 | // The permission configuration *must* be included to ensure security of the device |
| 212 | required: ["NetworkPermissionConfig"], |
Artur Satayev | 66780a8 | 2020-04-09 11:35:52 +0100 | [diff] [blame] | 213 | updatable: true, |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | // Android library to derive test APKs for integration tests |
| 217 | android_library { |
| 218 | name: "TestNetworkStackLib", |
Remi NGUYEN VAN | 16fe454 | 2020-01-16 13:48:38 +0900 | [diff] [blame] | 219 | defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"], |
| 220 | static_libs: ["NetworkStackApiStableLib"], |
Remi NGUYEN VAN | ae18aed | 2019-10-30 18:20:36 +0900 | [diff] [blame] | 221 | manifest: "AndroidManifestBase.xml", |
Remi NGUYEN VAN | 2c18f6b | 2020-05-25 18:27:59 +0900 | [diff] [blame] | 222 | visibility: [ |
| 223 | "//frameworks/base/tests/net/integration", |
| 224 | "//cts/tests/tests/net", |
Baligh Uddin | a472e98 | 2020-10-31 04:42:56 +0000 | [diff] [blame] | 225 | "//packages/modules/Connectivity/tests/cts/net", |
Remi NGUYEN VAN | 2c18f6b | 2020-05-25 18:27:59 +0900 | [diff] [blame] | 226 | ], |
Remi NGUYEN VAN | 9964576 | 2019-07-11 14:33:15 +0900 | [diff] [blame] | 227 | } |
| 228 | |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 229 | cc_library_shared { |
| 230 | name: "libnetworkstackutilsjni", |
| 231 | srcs: [ |
| 232 | "jni/network_stack_utils_jni.cpp" |
| 233 | ], |
Jooyung Han | 9b1bf05 | 2020-04-29 02:43:03 +0900 | [diff] [blame] | 234 | sdk_version: "29", |
| 235 | min_sdk_version: "29", |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 236 | shared_libs: [ |
| 237 | "liblog", |
Lorenzo Colitti | 88ddd88 | 2019-05-01 11:54:33 +0900 | [diff] [blame] | 238 | "libnativehelper_compat_libc++", |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 239 | ], |
Orion Hodson | 94561f6 | 2020-12-08 09:56:29 +0000 | [diff] [blame] | 240 | static_libs: [ |
| 241 | "libnetjniutils", |
| 242 | ], |
Lorenzo Colitti | 88ddd88 | 2019-05-01 11:54:33 +0900 | [diff] [blame] | 243 | |
| 244 | // We cannot use plain "libc++" here to link libc++ dynamically because it results in: |
| 245 | // java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found |
| 246 | // even if "libc++" is added into jni_libs below. Adding "libc++_shared" into jni_libs doesn't |
| 247 | // build because soong complains of: |
| 248 | // module NetworkStack missing dependencies: libc++_shared |
| 249 | // |
| 250 | // So, link libc++ statically. This means that we also need to ensure that all the C++ libraries |
| 251 | // we depend on do not dynamically link libc++. This is currently the case, because liblog is |
| 252 | // C-only and libnativehelper_compat_libc also uses stl: "c++_static". |
| 253 | // |
| 254 | // TODO: find a better solution for this in R. |
| 255 | stl: "c++_static", |
paulhu | e455e2a | 2019-03-29 17:22:20 +0800 | [diff] [blame] | 256 | cflags: [ |
| 257 | "-Wall", |
| 258 | "-Werror", |
| 259 | "-Wno-unused-parameter", |
| 260 | ], |
| 261 | } |
| 262 | |
Chiachang Wang | 8024227 | 2019-04-11 21:24:28 +0800 | [diff] [blame] | 263 | genrule { |
Remi NGUYEN VAN | da5f6bb | 2021-02-09 08:08:38 +0000 | [diff] [blame] | 264 | name: "statslog-networkstack-java-gen", |
Chiachang Wang | 8024227 | 2019-04-11 21:24:28 +0800 | [diff] [blame] | 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" + |
Remi NGUYEN VAN | da5f6bb | 2021-02-09 08:08:38 +0000 | [diff] [blame] | 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 | 1d52af0 | 2020-12-22 02:08:55 +0000 | [diff] [blame] | 287 | defaults: ["NetworkStackAppDefaults", "NetworkStackReleaseApiLevel"], |
| 288 | static_libs: ["NetworkStackApiStableLib"], |
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 | } |
lifr | 1995d8e | 2020-05-21 20:32:36 +0800 | [diff] [blame] | 294 | |
Remi NGUYEN VAN | e7c00c4 | 2020-06-22 18:50:20 +0900 | [diff] [blame] | 295 | // When adding or modifying protos, the jarjar rules and possibly proguard rules need |
| 296 | // to be updated: proto libraries may pull additional static libraries. |
lifr | 1995d8e | 2020-05-21 20:32:36 +0800 | [diff] [blame] | 297 | java_library_static { |
| 298 | name: "statsprotos", |
| 299 | proto: { |
| 300 | type: "lite", |
| 301 | }, |
| 302 | srcs: [ |
| 303 | "src/com/android/networkstack/metrics/stats.proto", |
| 304 | ], |
| 305 | static_libs: [ |
| 306 | "networkstackprotos", |
| 307 | ], |
| 308 | defaults: ["NetworkStackReleaseApiLevel"], |
| 309 | } |