| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 1 | // Copyright (C) 2019 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| Bob Badour | c446a52 | 2021-02-04 00:08:31 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 19 | java_defaults { |
| 20 | name: "wifi-module-sdk-version-defaults", |
| 21 | min_sdk_version: "30", |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 22 | } |
| 23 | |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 24 | filegroup { |
| 25 | name: "framework-wifi-updatable-exported-aidl-sources", |
| 26 | srcs: ["aidl-export/**/*.aidl"], |
| 27 | path: "aidl-export", |
| 28 | visibility: ["//visibility:private"], |
| 29 | } |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 30 | |
| 31 | filegroup { |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 32 | name: "framework-wifi-updatable-java-sources", |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 33 | srcs: [ |
| 34 | "java/**/*.java", |
| 35 | "java/**/*.aidl", |
| 36 | ], |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 37 | path: "java", |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 38 | visibility: ["//visibility:private"], |
| 39 | } |
| 40 | |
| 41 | filegroup { |
| 42 | name: "framework-wifi-updatable-sources", |
| 43 | srcs: [ |
| 44 | ":framework-wifi-updatable-java-sources", |
| 45 | ":framework-wifi-updatable-exported-aidl-sources", |
| David Su | 08f810e | 2020-12-09 10:40:18 -0800 | [diff] [blame] | 46 | ":module-utils-os-aidls", |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 47 | ], |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | filegroup { |
| David Su | 414e909 | 2019-12-14 21:37:20 -0800 | [diff] [blame] | 51 | name: "framework-wifi-annotations", |
| 52 | srcs: ["java/android/net/wifi/WifiAnnotations.java"], |
| 53 | } |
| 54 | |
| Nate Jiang | 72c34c12 | 2023-11-17 23:44:29 +0000 | [diff] [blame^] | 55 | filegroup { |
| 56 | name: "wifi_javadoc_only_files", |
| 57 | srcs: ["java/android/net/wifi/package.html", |
| 58 | "java/android/net/wifi/rtt/package.html", |
| 59 | "java/android/net/wifi/p2p/package.html", |
| 60 | "java/android/net/wifi/aware/package.html", |
| 61 | ], |
| 62 | path: "java/android/net/wifi", |
| 63 | } |
| 64 | |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 65 | // list of tests that are allowed to access @hide APIs from framework-wifi |
| 66 | test_access_hidden_api_whitelist = [ |
| 67 | "//frameworks/base/wifi/tests", |
| David Su | 00bb68f | 2020-12-03 14:28:24 -0800 | [diff] [blame] | 68 | "//frameworks/base/wifi/non-updatable/tests", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 69 | "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__", |
| David Su | e36d77e | 2019-12-18 21:22:21 -0800 | [diff] [blame] | 70 | |
| Baligh Uddin | d5af8cf | 2020-12-23 04:04:00 +0000 | [diff] [blame] | 71 | "//packages/modules/Wifi/framework/tests", |
| 72 | "//packages/modules/Wifi/service/tests/wifitests:__subpackages__", |
| 73 | |
| David Su | cd246f7 | 2020-01-07 13:01:30 -0800 | [diff] [blame] | 74 | "//external/robolectric-shadows:__subpackages__", |
| David Su | d9ab8ff | 2020-01-06 15:24:42 -0800 | [diff] [blame] | 75 | "//frameworks/base/packages/SettingsLib/tests/integ", |
| David Su | 16cbcd1 | 2020-01-11 16:22:00 -0800 | [diff] [blame] | 76 | "//external/sl4a:__subpackages__", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 77 | ] |
| 78 | |
| William Escande | 4367f1e | 2021-09-03 17:02:38 +0200 | [diff] [blame] | 79 | java_library { |
| 80 | name: "wifi-modules-utils", |
| 81 | sdk_version: "module_current", |
| 82 | min_sdk_version: "30", |
| 83 | static_libs: [ |
| 84 | "modules-utils-build", |
| William Escande | 7dca68d | 2021-09-20 19:54:45 +0200 | [diff] [blame] | 85 | "modules-utils-handlerexecutor", |
| William Escande | 4367f1e | 2021-09-03 17:02:38 +0200 | [diff] [blame] | 86 | "modules-utils-list-slice", |
| 87 | "modules-utils-preconditions", |
| William Escande | 7dca68d | 2021-09-20 19:54:45 +0200 | [diff] [blame] | 88 | "modules-utils-shell-command-handler", |
| 89 | "modules-utils-statemachine", |
| William Escande | 4367f1e | 2021-09-03 17:02:38 +0200 | [diff] [blame] | 90 | ], |
| 91 | apex_available: [ |
| 92 | "com.android.wifi", |
| 93 | "test_com.android.wifi", |
| 94 | ], |
| 95 | } |
| 96 | |
| David Su | 0c1d0c9 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 97 | // defaults shared between `framework-wifi` & `framework-wifi-pre-jarjar` |
| 98 | // java_sdk_library `framework-wifi` needs sources to generate stubs, so it cannot reuse |
| 99 | // `framework-wifi-pre-jarjar` |
| 100 | java_defaults { |
| 101 | name: "framework-wifi-defaults", |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 102 | defaults: ["wifi-module-sdk-version-defaults"], |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 103 | static_libs: [ |
| 104 | "framework-wifi-util-lib", |
| David Su | bcdd406 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 105 | "android.hardware.wifi-V1.0-java-constants", |
| William Escande | 4367f1e | 2021-09-03 17:02:38 +0200 | [diff] [blame] | 106 | "wifi-modules-utils", |
| Les Lee | af37e39 | 2022-03-16 16:06:41 +0800 | [diff] [blame] | 107 | "PlatformProperties", |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 108 | ], |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 109 | libs: [ |
| Anton Hansson | 29a5afb | 2022-01-25 16:59:31 +0000 | [diff] [blame] | 110 | "androidx.annotation_annotation", |
| David Su | bcdd406 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 111 | "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage |
| Les Lee | d0c76e4 | 2022-01-24 22:19:05 +0800 | [diff] [blame] | 112 | "app-compat-annotations", |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 113 | ], |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 114 | aidl: { |
| Siim Sammul | d9c0aa8 | 2022-08-15 11:34:31 +0000 | [diff] [blame] | 115 | generate_get_transaction_name: true, |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 116 | include_dirs: [ |
| Baligh Uddin | f009d85 | 2021-05-22 13:20:05 +0000 | [diff] [blame] | 117 | "packages/modules/Connectivity/framework/aidl-export", |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 118 | ], |
| 119 | }, |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 120 | srcs: [ |
| 121 | ":framework-wifi-updatable-sources", |
| David Su | 08f810e | 2020-12-09 10:40:18 -0800 | [diff] [blame] | 122 | ":module-utils-os-aidls", |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 123 | ], |
| David Su | 0c1d0c9 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | // wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility |
| 127 | // classes before they are renamed. |
| 128 | java_library { |
| 129 | name: "framework-wifi-pre-jarjar", |
| 130 | defaults: ["framework-wifi-defaults"], |
| 131 | sdk_version: "module_current", |
| Paul Duffin | df9c33f | 2023-11-02 19:19:40 +0000 | [diff] [blame] | 132 | libs: [ |
| 133 | "framework-annotations-lib", |
| 134 | "framework-connectivity.stubs.module_lib", |
| 135 | ], |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 136 | installable: false, |
| 137 | visibility: [ |
| 138 | "//frameworks/opt/net/wifi/service", |
| 139 | "//frameworks/opt/net/wifi/tests/wifitests", |
| Baligh Uddin | e65d766 | 2020-12-24 05:49:07 +0000 | [diff] [blame] | 140 | "//packages/modules/Wifi/service", |
| 141 | "//packages/modules/Wifi/service/tests/wifitests", |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 142 | ], |
| 143 | } |
| 144 | |
| 145 | // post-jarjar version of framework-wifi |
| Paul Duffin | d224b73 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 146 | java_sdk_library { |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 147 | name: "framework-wifi", |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 148 | defaults: [ |
| 149 | "framework-module-defaults", |
| David Su | 0c1d0c9 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 150 | "framework-wifi-defaults", |
| Paul Duffin | d224b73 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 151 | ], |
| 152 | |
| Paul Duffin | df9c33f | 2023-11-02 19:19:40 +0000 | [diff] [blame] | 153 | impl_only_libs: [ |
| 154 | "framework-connectivity.stubs.module_lib", |
| 155 | ], |
| 156 | |
| 157 | public: { |
| 158 | libs: ["framework-connectivity.stubs"] |
| 159 | }, |
| 160 | system: { |
| 161 | libs: ["framework-connectivity.stubs.system"] |
| 162 | }, |
| 163 | module_lib: { |
| 164 | libs: ["framework-connectivity.stubs.module_lib"] |
| 165 | }, |
| Nate Jiang | 72c34c12 | 2023-11-17 23:44:29 +0000 | [diff] [blame^] | 166 | api_srcs: [ |
| 167 | ":wifi_javadoc_only_files", |
| 168 | ], |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 169 | |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 170 | jarjar_rules: ":wifi-jarjar-rules", |
| 171 | |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 172 | installable: true, |
| 173 | optimize: { |
| 174 | enabled: false |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 175 | }, |
| Jiyong Park | e954a15 | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 176 | hostdex: true, // for hiddenapi check |
| Paul Duffin | 4b3c643 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 177 | |
| Paul Duffin | 4b3c643 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 178 | // Restrict access to implementation library. |
| 179 | impl_library_visibility: [ |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 180 | "//frameworks/opt/net/wifi/service:__subpackages__", |
| Baligh Uddin | e65d766 | 2020-12-24 05:49:07 +0000 | [diff] [blame] | 181 | "//packages/modules/Wifi/service:__subpackages__", |
| Quang Luong | 79a07cf | 2021-12-13 12:11:39 -0800 | [diff] [blame] | 182 | "//packages/modules/Wifi/WifiDialog:__subpackages__", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 183 | ] + test_access_hidden_api_whitelist, |
| Paul Duffin | 4b3c643 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 184 | |
| Jiyong Park | e954a15 | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 185 | apex_available: [ |
| 186 | "com.android.wifi", |
| 187 | "test_com.android.wifi", |
| 188 | ], |
| Vladimir Marko | 58338c4 | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 189 | permitted_packages: [ |
| 190 | "android.hardware.wifi", |
| 191 | "android.net.wifi", |
| Paul Duffin | bc41cb7 | 2020-05-28 14:55:44 +0100 | [diff] [blame] | 192 | // Created by jarjar rules. |
| 193 | "com.android.wifi.x", |
| Vladimir Marko | 58338c4 | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 194 | ], |
| Nate Jiang | 71d7586 | 2021-05-26 13:09:09 -0700 | [diff] [blame] | 195 | lint: { |
| 196 | strict_updatability_linting: true, |
| 197 | }, |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 198 | } |
| 199 | |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 200 | // defaults for tests that need to build against framework-wifi's @hide APIs |
| 201 | java_defaults { |
| 202 | name: "framework-wifi-test-defaults", |
| David Su | 85ef0ad | 2020-11-25 10:55:11 -0800 | [diff] [blame] | 203 | sdk_version: "core_current", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 204 | libs: [ |
| David Su | 8843a2d | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 205 | // order matters: classes in framework-wifi are resolved before framework, meaning |
| 206 | // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework |
| Paul Duffin | d224b73 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 207 | "framework-wifi.impl", |
| David Su | 8843a2d | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 208 | "framework", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 209 | |
| 210 | // if sdk_version="" this gets automatically included, but here we need to add manually. |
| 211 | "framework-res", |
| 212 | ], |
| 213 | visibility: test_access_hidden_api_whitelist, |
| 214 | } |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 215 | |
| 216 | filegroup { |
| 217 | name: "wifi-jarjar-rules", |
| 218 | srcs: ["jarjar-rules.txt"], |
| 219 | } |
| Les Lee | d0c76e4 | 2022-01-24 22:19:05 +0800 | [diff] [blame] | 220 | |
| 221 | platform_compat_config |
| 222 | { |
| 223 | name: "wifi-compat-config", |
| 224 | src: ":framework-wifi-pre-jarjar", |
| 225 | } |
| Jihoon Kang | f5092f8 | 2022-12-06 18:11:10 +0000 | [diff] [blame] | 226 | |
| 227 | java_api_contribution { |
| 228 | name: "framework-wifi-public-stubs", |
| 229 | api_surface: "public", |
| 230 | api_file: "api/current.txt", |
| 231 | visibility: [ |
| 232 | "//build/orchestrator/apis", |
| 233 | ], |
| 234 | } |
| Jihoon Kang | 7e8de48 | 2023-01-03 20:28:00 +0000 | [diff] [blame] | 235 | |
| 236 | java_api_contribution { |
| 237 | name: "framework-wifi-system-stubs", |
| 238 | api_surface: "system", |
| 239 | api_file: "api/system-current.txt", |
| 240 | visibility: [ |
| 241 | "//build/orchestrator/apis", |
| 242 | ], |
| 243 | } |
| 244 | |
| 245 | java_api_contribution { |
| 246 | name: "framework-wifi-module-lib-stubs", |
| 247 | api_surface: "module-lib", |
| 248 | api_file: "api/module-lib-current.txt", |
| 249 | visibility: [ |
| 250 | "//build/orchestrator/apis", |
| 251 | ], |
| 252 | } |