blob: f4d28817a7f2ed987b73a1824d78e9c2953d732a [file] [log] [blame]
David Su754fcc22019-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
David Su6dcd7682020-01-21 11:23:00 -080015filegroup {
16 name: "framework-wifi-updatable-exported-aidl-sources",
17 srcs: ["aidl-export/**/*.aidl"],
18 path: "aidl-export",
19 visibility: ["//visibility:private"],
20}
David Su754fcc22019-09-04 14:31:58 -070021
22filegroup {
David Su6dcd7682020-01-21 11:23:00 -080023 name: "framework-wifi-updatable-java-sources",
David Su754fcc22019-09-04 14:31:58 -070024 srcs: [
25 "java/**/*.java",
26 "java/**/*.aidl",
27 ],
28 exclude_srcs: [
29 ":framework-wifi-non-updatable-sources"
30 ],
31 path: "java",
David Su6dcd7682020-01-21 11:23:00 -080032 visibility: ["//visibility:private"],
33}
34
35filegroup {
36 name: "framework-wifi-updatable-sources",
37 srcs: [
38 ":framework-wifi-updatable-java-sources",
39 ":framework-wifi-updatable-exported-aidl-sources",
40 ],
David Su754fcc22019-09-04 14:31:58 -070041}
42
43filegroup {
44 name: "framework-wifi-non-updatable-sources",
45 srcs: [
46 // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and
47 // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache
48 // to a separate package.
49 "java/android/net/wifi/WifiNetworkScoreCache.java",
Roshan Pius807b34a2020-02-24 09:12:52 -080050 "java/android/net/wifi/WifiMigration.java",
Etan Cohen804d94a2020-02-15 17:33:27 -080051 "java/android/net/wifi/nl80211/*.java",
David Su754fcc22019-09-04 14:31:58 -070052 ":libwificond_ipc_aidl",
53 ],
54}
55
David Su130441b2019-12-14 21:37:20 -080056filegroup {
57 name: "framework-wifi-annotations",
58 srcs: ["java/android/net/wifi/WifiAnnotations.java"],
59}
60
David Su90ed1052019-12-18 18:20:28 -080061// list of tests that are allowed to access @hide APIs from framework-wifi
62test_access_hidden_api_whitelist = [
63 "//frameworks/base/wifi/tests",
64 "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
David Su434fe602019-12-18 21:22:21 -080065
David Su4c5bab62020-01-07 13:01:30 -080066 "//external/robolectric-shadows:__subpackages__",
David Su6c00e382020-01-06 15:24:42 -080067 "//frameworks/base/packages/SettingsLib/tests/integ",
David Su812a8f12020-01-11 16:22:00 -080068 "//external/sl4a:__subpackages__",
David Su90ed1052019-12-18 18:20:28 -080069]
70
David Su511a8142020-01-09 14:02:21 -080071// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
72// classes before they are renamed.
David Su754fcc22019-09-04 14:31:58 -070073java_library {
David Su511a8142020-01-09 14:02:21 -080074 name: "framework-wifi-pre-jarjar",
David Su439175f2020-01-17 21:16:31 +000075 // TODO(b/146757305): sdk_version should be "module_lib_current"
76 sdk_version: "core_current",
David Su511a8142020-01-09 14:02:21 -080077 static_libs: [
78 "framework-wifi-util-lib",
David Su369c9202020-01-09 18:09:56 -080079 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -080080 ],
David Su754fcc22019-09-04 14:31:58 -070081 libs: [
David Su369c9202020-01-09 18:09:56 -080082 "framework-annotations-lib",
83 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
84 "unsupportedappusage-annotation", // for dalvik.annotation.compat.UnsupportedAppUsage
Chen Xu546ce5e2020-01-10 08:38:31 -080085 "framework-telephony-stubs",
David Su439175f2020-01-17 21:16:31 +000086 // TODO(b/146757305): should be unnecessary once
87 // sdk_version="module_lib_current"
88 "android_system_stubs_current",
David Su754fcc22019-09-04 14:31:58 -070089 ],
90 srcs: [
91 ":framework-wifi-updatable-sources",
David Su72f9d632020-02-10 15:58:26 -080092 ":framework-wifi-util-lib-aidls",
David Su754fcc22019-09-04 14:31:58 -070093 ],
David Sua6f0c862020-01-21 16:45:50 -080094 // java_api_finder must accompany `srcs`
95 plugins: ["java_api_finder"],
David Su511a8142020-01-09 14:02:21 -080096 installable: false,
97 visibility: [
98 "//frameworks/opt/net/wifi/service",
99 "//frameworks/opt/net/wifi/tests/wifitests",
100 ],
David Su439175f2020-01-17 21:16:31 +0000101
102 // TODO(b/146757305): should be unnecessary once
103 // sdk_version="module_lib_current"
104 aidl: {
105 include_dirs: [
106 "frameworks/base/core/java",
107 ],
108 },
David Su511a8142020-01-09 14:02:21 -0800109}
110
111// post-jarjar version of framework-wifi
112java_library {
113 name: "framework-wifi",
David Su439175f2020-01-17 21:16:31 +0000114 // TODO(b/146757305): sdk_version should be "module_lib_current"
115 sdk_version: "core_current",
David Su511a8142020-01-09 14:02:21 -0800116 static_libs: [
117 "framework-wifi-pre-jarjar",
118 ],
119 jarjar_rules: ":wifi-jarjar-rules",
120
David Su754fcc22019-09-04 14:31:58 -0700121 installable: true,
122 optimize: {
123 enabled: false
David Su90ed1052019-12-18 18:20:28 -0800124 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900125 hostdex: true, // for hiddenapi check
David Su90ed1052019-12-18 18:20:28 -0800126 visibility: [
David Su90ed1052019-12-18 18:20:28 -0800127 "//frameworks/opt/net/wifi/service:__subpackages__",
128 ] + test_access_hidden_api_whitelist,
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900129 apex_available: [
130 "com.android.wifi",
131 "test_com.android.wifi",
132 ],
David Su754fcc22019-09-04 14:31:58 -0700133}
134
Anton Hansson6656c502020-02-05 09:49:35 +0000135stubs_defaults {
136 name: "framework-wifi-stubs-srcs-defaults",
Anton Hanssond20f0302020-02-05 09:46:24 +0000137 srcs: [
Anton Hanssond20f0302020-02-05 09:46:24 +0000138 ":framework-wifi-updatable-sources",
Anton Hansson6656c502020-02-05 09:49:35 +0000139 ":framework-wifi-util-lib-aidls",
Anton Hanssond20f0302020-02-05 09:46:24 +0000140 ],
Anton Hansson6656c502020-02-05 09:49:35 +0000141 libs: [ "framework-annotations-lib" ],
142 sdk_version: "module_current",
143}
144
145droidstubs {
146 name: "framework-wifi-stubs-srcs-publicapi",
147 defaults: [
148 "framework-module-stubs-defaults-publicapi",
149 "framework-wifi-stubs-srcs-defaults",
150 ],
151}
152
153droidstubs {
154 name: "framework-wifi-stubs-srcs-systemapi",
155 defaults: [
156 "framework-module-stubs-defaults-systemapi",
157 "framework-wifi-stubs-srcs-defaults",
158 ],
159}
160
161droidstubs {
162 name: "framework-wifi-api-module_libs_api",
163 defaults: [
164 "framework-module-api-defaults-module_libs_api",
165 "framework-wifi-stubs-srcs-defaults",
166 ],
167}
168
169droidstubs {
170 name: "framework-wifi-stubs-srcs-module_libs_api",
171 defaults: [
172 "framework-module-stubs-defaults-module_libs_api",
173 "framework-wifi-stubs-srcs-defaults",
174 ],
David Su754fcc22019-09-04 14:31:58 -0700175}
176
177java_library {
Anton Hansson6656c502020-02-05 09:49:35 +0000178 name: "framework-wifi-stubs-publicapi",
179 srcs: [":framework-wifi-stubs-srcs-publicapi"],
Anton Hansson15273532020-03-09 19:14:28 +0000180 sdk_version: "current",
Anton Hansson6656c502020-02-05 09:49:35 +0000181 installable: false,
182}
183
184java_library {
185 name: "framework-wifi-stubs-systemapi",
186 srcs: [":framework-wifi-stubs-srcs-systemapi"],
Anton Hansson15273532020-03-09 19:14:28 +0000187 sdk_version: "system_current",
Anton Hansson6656c502020-02-05 09:49:35 +0000188 libs: ["framework-annotations-lib"],
189 installable: false,
190}
191
192java_library {
193 name: "framework-wifi-stubs-module_libs_api",
194 srcs: [":framework-wifi-stubs-srcs-module_libs_api"],
195 sdk_version: "module_current",
196 libs: ["framework-annotations-lib"],
David Su754fcc22019-09-04 14:31:58 -0700197 installable: false,
198}
199
David Su90ed1052019-12-18 18:20:28 -0800200// defaults for tests that need to build against framework-wifi's @hide APIs
201java_defaults {
202 name: "framework-wifi-test-defaults",
203 sdk_version: "core_platform", // tests can use @CorePlatformApi's
204 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800205 // order matters: classes in framework-wifi are resolved before framework, meaning
206 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
David Su90ed1052019-12-18 18:20:28 -0800207 "framework-wifi",
David Succ38e1f2020-01-07 19:47:28 -0800208 "framework",
David Su90ed1052019-12-18 18:20:28 -0800209
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 Su511a8142020-01-09 14:02:21 -0800215
216filegroup {
217 name: "wifi-jarjar-rules",
218 srcs: ["jarjar-rules.txt"],
219}