blob: 6a8600a5baa4481a52af9b20608dfeeda193f293 [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.
Roshan Piusaa6527c2020-03-18 08:19:35 -070049 "java/android/net/wifi/SoftApConfToXmlMigrationUtil.java",
David Su754fcc22019-09-04 14:31:58 -070050 "java/android/net/wifi/WifiNetworkScoreCache.java",
Roshan Pius807b34a2020-02-24 09:12:52 -080051 "java/android/net/wifi/WifiMigration.java",
Etan Cohen804d94a2020-02-15 17:33:27 -080052 "java/android/net/wifi/nl80211/*.java",
David Su754fcc22019-09-04 14:31:58 -070053 ":libwificond_ipc_aidl",
54 ],
55}
56
David Su130441b2019-12-14 21:37:20 -080057filegroup {
58 name: "framework-wifi-annotations",
59 srcs: ["java/android/net/wifi/WifiAnnotations.java"],
60}
61
David Su90ed1052019-12-18 18:20:28 -080062// list of tests that are allowed to access @hide APIs from framework-wifi
63test_access_hidden_api_whitelist = [
64 "//frameworks/base/wifi/tests",
65 "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
David Su434fe602019-12-18 21:22:21 -080066
David Su4c5bab62020-01-07 13:01:30 -080067 "//external/robolectric-shadows:__subpackages__",
David Su6c00e382020-01-06 15:24:42 -080068 "//frameworks/base/packages/SettingsLib/tests/integ",
David Su812a8f12020-01-11 16:22:00 -080069 "//external/sl4a:__subpackages__",
David Su90ed1052019-12-18 18:20:28 -080070]
71
David Su511a8142020-01-09 14:02:21 -080072// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
73// classes before they are renamed.
David Su754fcc22019-09-04 14:31:58 -070074java_library {
David Su511a8142020-01-09 14:02:21 -080075 name: "framework-wifi-pre-jarjar",
David Su3c0d1972020-03-16 15:53:48 -070076 sdk_version: "module_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
David Su754fcc22019-09-04 14:31:58 -070084 ],
85 srcs: [
86 ":framework-wifi-updatable-sources",
David Su72f9d632020-02-10 15:58:26 -080087 ":framework-wifi-util-lib-aidls",
David Su754fcc22019-09-04 14:31:58 -070088 ],
David Sua6f0c862020-01-21 16:45:50 -080089 // java_api_finder must accompany `srcs`
90 plugins: ["java_api_finder"],
David Su511a8142020-01-09 14:02:21 -080091 installable: false,
92 visibility: [
93 "//frameworks/opt/net/wifi/service",
94 "//frameworks/opt/net/wifi/tests/wifitests",
95 ],
96}
97
98// post-jarjar version of framework-wifi
99java_library {
100 name: "framework-wifi",
David Su3c0d1972020-03-16 15:53:48 -0700101 sdk_version: "module_current",
David Su511a8142020-01-09 14:02:21 -0800102 static_libs: [
103 "framework-wifi-pre-jarjar",
104 ],
105 jarjar_rules: ":wifi-jarjar-rules",
106
David Su754fcc22019-09-04 14:31:58 -0700107 installable: true,
108 optimize: {
109 enabled: false
David Su90ed1052019-12-18 18:20:28 -0800110 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900111 hostdex: true, // for hiddenapi check
David Su90ed1052019-12-18 18:20:28 -0800112 visibility: [
David Su90ed1052019-12-18 18:20:28 -0800113 "//frameworks/opt/net/wifi/service:__subpackages__",
114 ] + test_access_hidden_api_whitelist,
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900115 apex_available: [
116 "com.android.wifi",
117 "test_com.android.wifi",
118 ],
Vladimir Marko8a71e9b2020-03-19 14:30:21 +0000119 permitted_packages: [
120 "android.hardware.wifi",
121 "android.net.wifi",
122 "android.x.net.wifi",
123 ],
David Su754fcc22019-09-04 14:31:58 -0700124}
125
Anton Hansson6656c502020-02-05 09:49:35 +0000126stubs_defaults {
127 name: "framework-wifi-stubs-srcs-defaults",
Anton Hanssond20f0302020-02-05 09:46:24 +0000128 srcs: [
Anton Hanssond20f0302020-02-05 09:46:24 +0000129 ":framework-wifi-updatable-sources",
Anton Hansson6656c502020-02-05 09:49:35 +0000130 ":framework-wifi-util-lib-aidls",
Anton Hanssond20f0302020-02-05 09:46:24 +0000131 ],
Anton Hansson2e53a532020-03-31 14:49:19 +0100132 libs: [
133 "framework-annotations-lib",
134 "framework-wifi-util-lib",
135 ],
Anton Hansson6656c502020-02-05 09:49:35 +0000136 sdk_version: "module_current",
Anton Hansson8bf731c2020-04-30 14:26:22 +0100137 dist: { dest: "framework-wifi.txt" },
Anton Hansson6656c502020-02-05 09:49:35 +0000138}
139
140droidstubs {
141 name: "framework-wifi-stubs-srcs-publicapi",
142 defaults: [
143 "framework-module-stubs-defaults-publicapi",
144 "framework-wifi-stubs-srcs-defaults",
145 ],
146}
147
148droidstubs {
149 name: "framework-wifi-stubs-srcs-systemapi",
150 defaults: [
151 "framework-module-stubs-defaults-systemapi",
152 "framework-wifi-stubs-srcs-defaults",
153 ],
154}
155
156droidstubs {
157 name: "framework-wifi-api-module_libs_api",
158 defaults: [
159 "framework-module-api-defaults-module_libs_api",
160 "framework-wifi-stubs-srcs-defaults",
161 ],
162}
163
164droidstubs {
165 name: "framework-wifi-stubs-srcs-module_libs_api",
166 defaults: [
167 "framework-module-stubs-defaults-module_libs_api",
168 "framework-wifi-stubs-srcs-defaults",
169 ],
David Su754fcc22019-09-04 14:31:58 -0700170}
171
172java_library {
Anton Hansson6656c502020-02-05 09:49:35 +0000173 name: "framework-wifi-stubs-publicapi",
174 srcs: [":framework-wifi-stubs-srcs-publicapi"],
Anton Hansson013dc722020-03-24 19:50:06 +0000175 defaults: ["framework-module-stubs-lib-defaults-publicapi"],
Anton Hansson8bf731c2020-04-30 14:26:22 +0100176 dist: { dest: "framework-wifi.jar" },
Anton Hansson6656c502020-02-05 09:49:35 +0000177}
178
179java_library {
180 name: "framework-wifi-stubs-systemapi",
181 srcs: [":framework-wifi-stubs-srcs-systemapi"],
Anton Hansson6656c502020-02-05 09:49:35 +0000182 libs: ["framework-annotations-lib"],
Anton Hansson013dc722020-03-24 19:50:06 +0000183 defaults: ["framework-module-stubs-lib-defaults-systemapi"],
Anton Hansson8bf731c2020-04-30 14:26:22 +0100184 dist: { dest: "framework-wifi.jar" },
Anton Hansson6656c502020-02-05 09:49:35 +0000185}
186
187java_library {
188 name: "framework-wifi-stubs-module_libs_api",
189 srcs: [":framework-wifi-stubs-srcs-module_libs_api"],
Anton Hansson6656c502020-02-05 09:49:35 +0000190 libs: ["framework-annotations-lib"],
Anton Hansson013dc722020-03-24 19:50:06 +0000191 defaults: ["framework-module-stubs-lib-defaults-module_libs_api"],
Anton Hansson8bf731c2020-04-30 14:26:22 +0100192 dist: { dest: "framework-wifi.jar" },
David Su754fcc22019-09-04 14:31:58 -0700193}
194
David Su90ed1052019-12-18 18:20:28 -0800195// defaults for tests that need to build against framework-wifi's @hide APIs
196java_defaults {
197 name: "framework-wifi-test-defaults",
198 sdk_version: "core_platform", // tests can use @CorePlatformApi's
199 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800200 // order matters: classes in framework-wifi are resolved before framework, meaning
201 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
David Su90ed1052019-12-18 18:20:28 -0800202 "framework-wifi",
David Succ38e1f2020-01-07 19:47:28 -0800203 "framework",
David Su90ed1052019-12-18 18:20:28 -0800204
205 // if sdk_version="" this gets automatically included, but here we need to add manually.
206 "framework-res",
207 ],
208 visibility: test_access_hidden_api_whitelist,
209}
David Su511a8142020-01-09 14:02:21 -0800210
211filegroup {
212 name: "wifi-jarjar-rules",
213 srcs: ["jarjar-rules.txt"],
214}