blob: f394c7d6eb703a1e441e825c45f6bd6963c7c0ac [file] [log] [blame]
David Su4b3032f2019-09-04 14:31:58 -07001// 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 Badourc446a522021-02-04 00:08:31 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
David Su9ca5d402020-06-10 12:39:07 -070019java_defaults {
20 name: "wifi-module-sdk-version-defaults",
21 min_sdk_version: "30",
David Su9ca5d402020-06-10 12:39:07 -070022}
23
David Su005f8902020-01-21 11:23:00 -080024filegroup {
25 name: "framework-wifi-updatable-exported-aidl-sources",
26 srcs: ["aidl-export/**/*.aidl"],
27 path: "aidl-export",
28 visibility: ["//visibility:private"],
29}
David Su4b3032f2019-09-04 14:31:58 -070030
31filegroup {
David Su005f8902020-01-21 11:23:00 -080032 name: "framework-wifi-updatable-java-sources",
David Su4b3032f2019-09-04 14:31:58 -070033 srcs: [
34 "java/**/*.java",
35 "java/**/*.aidl",
36 ],
David Su4b3032f2019-09-04 14:31:58 -070037 path: "java",
David Su005f8902020-01-21 11:23:00 -080038 visibility: ["//visibility:private"],
39}
40
41filegroup {
42 name: "framework-wifi-updatable-sources",
43 srcs: [
44 ":framework-wifi-updatable-java-sources",
45 ":framework-wifi-updatable-exported-aidl-sources",
David Su08f810e2020-12-09 10:40:18 -080046 ":module-utils-os-aidls",
David Su005f8902020-01-21 11:23:00 -080047 ],
David Su4b3032f2019-09-04 14:31:58 -070048}
49
50filegroup {
David Su414e9092019-12-14 21:37:20 -080051 name: "framework-wifi-annotations",
52 srcs: ["java/android/net/wifi/WifiAnnotations.java"],
53}
54
David Sudc878b82019-12-18 18:20:28 -080055// list of tests that are allowed to access @hide APIs from framework-wifi
56test_access_hidden_api_whitelist = [
57 "//frameworks/base/wifi/tests",
David Su00bb68f2020-12-03 14:28:24 -080058 "//frameworks/base/wifi/non-updatable/tests",
David Sudc878b82019-12-18 18:20:28 -080059 "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
David Sue36d77e2019-12-18 21:22:21 -080060
Baligh Uddind5af8cf2020-12-23 04:04:00 +000061 "//packages/modules/Wifi/framework/tests",
62 "//packages/modules/Wifi/service/tests/wifitests:__subpackages__",
63
David Sucd246f72020-01-07 13:01:30 -080064 "//external/robolectric-shadows:__subpackages__",
David Sud9ab8ff2020-01-06 15:24:42 -080065 "//frameworks/base/packages/SettingsLib/tests/integ",
David Su16cbcd12020-01-11 16:22:00 -080066 "//external/sl4a:__subpackages__",
David Sudc878b82019-12-18 18:20:28 -080067]
68
William Escande4367f1e2021-09-03 17:02:38 +020069java_library {
70 name: "wifi-modules-utils",
71 sdk_version: "module_current",
72 min_sdk_version: "30",
73 static_libs: [
74 "modules-utils-build",
William Escande7dca68d2021-09-20 19:54:45 +020075 "modules-utils-handlerexecutor",
William Escande4367f1e2021-09-03 17:02:38 +020076 "modules-utils-list-slice",
77 "modules-utils-preconditions",
William Escande7dca68d2021-09-20 19:54:45 +020078 "modules-utils-shell-command-handler",
79 "modules-utils-statemachine",
William Escande4367f1e2021-09-03 17:02:38 +020080 ],
81 apex_available: [
82 "com.android.wifi",
83 "test_com.android.wifi",
84 ],
85}
86
David Su0c1d0c92020-10-26 11:12:04 -070087// defaults shared between `framework-wifi` & `framework-wifi-pre-jarjar`
88// java_sdk_library `framework-wifi` needs sources to generate stubs, so it cannot reuse
89// `framework-wifi-pre-jarjar`
90java_defaults {
91 name: "framework-wifi-defaults",
David Su9ca5d402020-06-10 12:39:07 -070092 defaults: ["wifi-module-sdk-version-defaults"],
David Su5d01d6d2020-01-09 14:02:21 -080093 static_libs: [
94 "framework-wifi-util-lib",
David Subcdd4062020-01-09 18:09:56 -080095 "android.hardware.wifi-V1.0-java-constants",
William Escande4367f1e2021-09-03 17:02:38 +020096 "wifi-modules-utils",
Les Leeaf37e392022-03-16 16:06:41 +080097 "PlatformProperties",
David Su5d01d6d2020-01-09 14:02:21 -080098 ],
David Su4b3032f2019-09-04 14:31:58 -070099 libs: [
Anton Hansson29a5afb2022-01-25 16:59:31 +0000100 "androidx.annotation_annotation",
David Subcdd4062020-01-09 18:09:56 -0800101 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
Les Leed0c76e42022-01-24 22:19:05 +0800102 "app-compat-annotations",
David Su4b3032f2019-09-04 14:31:58 -0700103 ],
Remi NGUYEN VAN37237ba2021-01-14 16:44:22 +0900104 aidl: {
Siim Sammuld9c0aa82022-08-15 11:34:31 +0000105 generate_get_transaction_name: true,
Remi NGUYEN VAN37237ba2021-01-14 16:44:22 +0900106 include_dirs: [
Baligh Uddinf009d852021-05-22 13:20:05 +0000107 "packages/modules/Connectivity/framework/aidl-export",
Remi NGUYEN VAN37237ba2021-01-14 16:44:22 +0900108 ],
109 },
David Su4b3032f2019-09-04 14:31:58 -0700110 srcs: [
111 ":framework-wifi-updatable-sources",
David Su08f810e2020-12-09 10:40:18 -0800112 ":module-utils-os-aidls",
David Su4b3032f2019-09-04 14:31:58 -0700113 ],
David Su0c1d0c92020-10-26 11:12:04 -0700114}
115
116// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
117// classes before they are renamed.
118java_library {
119 name: "framework-wifi-pre-jarjar",
120 defaults: ["framework-wifi-defaults"],
121 sdk_version: "module_current",
Jihoon Kang201e81a2023-11-02 19:40:56 +0000122 libs: [
123 "framework-annotations-lib",
124 "framework-connectivity.stubs.module_lib",
125 "framework-location.stubs.module_lib",
126 ],
David Su5d01d6d2020-01-09 14:02:21 -0800127 installable: false,
128 visibility: [
129 "//frameworks/opt/net/wifi/service",
130 "//frameworks/opt/net/wifi/tests/wifitests",
Baligh Uddine65d7662020-12-24 05:49:07 +0000131 "//packages/modules/Wifi/service",
132 "//packages/modules/Wifi/service/tests/wifitests",
David Su5d01d6d2020-01-09 14:02:21 -0800133 ],
134}
135
136// post-jarjar version of framework-wifi
Paul Duffind224b732020-05-13 20:33:29 +0100137java_sdk_library {
David Su5d01d6d2020-01-09 14:02:21 -0800138 name: "framework-wifi",
David Su9ca5d402020-06-10 12:39:07 -0700139 defaults: [
140 "framework-module-defaults",
David Su0c1d0c92020-10-26 11:12:04 -0700141 "framework-wifi-defaults",
Paul Duffind224b732020-05-13 20:33:29 +0100142 ],
143
Jihoon Kang201e81a2023-11-02 19:40:56 +0000144 impl_only_libs: [
Mark White988d3662023-07-25 23:02:57 +0000145 "framework-location.stubs.module_lib",
146 "framework-connectivity.stubs.module_lib",
147 ],
Remi NGUYEN VAN37237ba2021-01-14 16:44:22 +0900148
Jihoon Kang201e81a2023-11-02 19:40:56 +0000149 public: {
150 libs: ["framework-location.stubs", "framework-connectivity.stubs"]
151 },
152 system: {
153 libs: ["framework-location.stubs.system", "framework-connectivity.stubs.system"]
154 },
155 module_lib: {
156 libs: ["framework-location.stubs.module_lib", "framework-connectivity.stubs.module_lib"]
157 },
158
David Su5d01d6d2020-01-09 14:02:21 -0800159 jarjar_rules: ":wifi-jarjar-rules",
160
David Su4b3032f2019-09-04 14:31:58 -0700161 installable: true,
162 optimize: {
163 enabled: false
David Sudc878b82019-12-18 18:20:28 -0800164 },
Jiyong Parke954a152020-01-06 13:30:59 +0900165 hostdex: true, // for hiddenapi check
Paul Duffin4b3c6432020-05-31 11:32:06 +0100166
Paul Duffin4b3c6432020-05-31 11:32:06 +0100167 // Restrict access to implementation library.
168 impl_library_visibility: [
David Sudc878b82019-12-18 18:20:28 -0800169 "//frameworks/opt/net/wifi/service:__subpackages__",
Baligh Uddine65d7662020-12-24 05:49:07 +0000170 "//packages/modules/Wifi/service:__subpackages__",
Quang Luong79a07cf2021-12-13 12:11:39 -0800171 "//packages/modules/Wifi/WifiDialog:__subpackages__",
David Sudc878b82019-12-18 18:20:28 -0800172 ] + test_access_hidden_api_whitelist,
Paul Duffin4b3c6432020-05-31 11:32:06 +0100173
Jiyong Parke954a152020-01-06 13:30:59 +0900174 apex_available: [
175 "com.android.wifi",
176 "test_com.android.wifi",
177 ],
Vladimir Marko58338c42020-03-19 14:30:21 +0000178 permitted_packages: [
179 "android.hardware.wifi",
180 "android.net.wifi",
Paul Duffinbc41cb72020-05-28 14:55:44 +0100181 // Created by jarjar rules.
182 "com.android.wifi.x",
Vladimir Marko58338c42020-03-19 14:30:21 +0000183 ],
Nate Jiang71d75862021-05-26 13:09:09 -0700184 lint: {
185 strict_updatability_linting: true,
186 },
David Su4b3032f2019-09-04 14:31:58 -0700187}
188
David Sudc878b82019-12-18 18:20:28 -0800189// defaults for tests that need to build against framework-wifi's @hide APIs
190java_defaults {
191 name: "framework-wifi-test-defaults",
David Su85ef0ad2020-11-25 10:55:11 -0800192 sdk_version: "core_current",
David Sudc878b82019-12-18 18:20:28 -0800193 libs: [
David Su8843a2d2020-01-07 19:47:28 -0800194 // order matters: classes in framework-wifi are resolved before framework, meaning
195 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
Paul Duffind224b732020-05-13 20:33:29 +0100196 "framework-wifi.impl",
David Su8843a2d2020-01-07 19:47:28 -0800197 "framework",
David Sudc878b82019-12-18 18:20:28 -0800198
199 // if sdk_version="" this gets automatically included, but here we need to add manually.
200 "framework-res",
201 ],
202 visibility: test_access_hidden_api_whitelist,
203}
David Su5d01d6d2020-01-09 14:02:21 -0800204
205filegroup {
206 name: "wifi-jarjar-rules",
207 srcs: ["jarjar-rules.txt"],
208}
Les Leed0c76e42022-01-24 22:19:05 +0800209
210platform_compat_config
211{
212 name: "wifi-compat-config",
213 src: ":framework-wifi-pre-jarjar",
214}
Jihoon Kangf5092f82022-12-06 18:11:10 +0000215
216java_api_contribution {
217 name: "framework-wifi-public-stubs",
218 api_surface: "public",
219 api_file: "api/current.txt",
220 visibility: [
221 "//build/orchestrator/apis",
222 ],
223}
Jihoon Kang7e8de482023-01-03 20:28:00 +0000224
225java_api_contribution {
226 name: "framework-wifi-system-stubs",
227 api_surface: "system",
228 api_file: "api/system-current.txt",
229 visibility: [
230 "//build/orchestrator/apis",
231 ],
232}
233
234java_api_contribution {
235 name: "framework-wifi-module-lib-stubs",
236 api_surface: "module-lib",
237 api_file: "api/module-lib-current.txt",
238 visibility: [
239 "//build/orchestrator/apis",
240 ],
241}