blob: 3f4542c585c79c57cab2d106f7ebbbe1ddee8a64 [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 Su27953f12020-06-10 12:39:07 -070015java_defaults {
16 name: "wifi-module-sdk-version-defaults",
17 min_sdk_version: "30",
18 target_sdk_version: "30",
19}
20
David Su6dcd7682020-01-21 11:23:00 -080021filegroup {
22 name: "framework-wifi-updatable-exported-aidl-sources",
23 srcs: ["aidl-export/**/*.aidl"],
24 path: "aidl-export",
25 visibility: ["//visibility:private"],
26}
David Su754fcc22019-09-04 14:31:58 -070027
28filegroup {
David Su6dcd7682020-01-21 11:23:00 -080029 name: "framework-wifi-updatable-java-sources",
David Su754fcc22019-09-04 14:31:58 -070030 srcs: [
31 "java/**/*.java",
32 "java/**/*.aidl",
33 ],
34 exclude_srcs: [
35 ":framework-wifi-non-updatable-sources"
36 ],
37 path: "java",
David Su6dcd7682020-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",
46 ],
David Su754fcc22019-09-04 14:31:58 -070047}
48
49filegroup {
50 name: "framework-wifi-non-updatable-sources",
51 srcs: [
52 // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and
53 // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache
54 // to a separate package.
Roshan Piusaa6527c2020-03-18 08:19:35 -070055 "java/android/net/wifi/SoftApConfToXmlMigrationUtil.java",
David Su754fcc22019-09-04 14:31:58 -070056 "java/android/net/wifi/WifiNetworkScoreCache.java",
Roshan Pius807b34a2020-02-24 09:12:52 -080057 "java/android/net/wifi/WifiMigration.java",
Etan Cohen804d94a2020-02-15 17:33:27 -080058 "java/android/net/wifi/nl80211/*.java",
David Su754fcc22019-09-04 14:31:58 -070059 ":libwificond_ipc_aidl",
60 ],
61}
62
David Su130441b2019-12-14 21:37:20 -080063filegroup {
64 name: "framework-wifi-annotations",
65 srcs: ["java/android/net/wifi/WifiAnnotations.java"],
66}
67
David Su90ed1052019-12-18 18:20:28 -080068// list of tests that are allowed to access @hide APIs from framework-wifi
69test_access_hidden_api_whitelist = [
70 "//frameworks/base/wifi/tests",
71 "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
David Su434fe602019-12-18 21:22:21 -080072
David Su4c5bab62020-01-07 13:01:30 -080073 "//external/robolectric-shadows:__subpackages__",
David Su6c00e382020-01-06 15:24:42 -080074 "//frameworks/base/packages/SettingsLib/tests/integ",
David Su812a8f12020-01-11 16:22:00 -080075 "//external/sl4a:__subpackages__",
David Su90ed1052019-12-18 18:20:28 -080076]
77
David Su511a8142020-01-09 14:02:21 -080078// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
79// classes before they are renamed.
David Su754fcc22019-09-04 14:31:58 -070080java_library {
David Su511a8142020-01-09 14:02:21 -080081 name: "framework-wifi-pre-jarjar",
David Su27953f12020-06-10 12:39:07 -070082 defaults: ["wifi-module-sdk-version-defaults"],
David Su3c0d1972020-03-16 15:53:48 -070083 sdk_version: "module_current",
David Su511a8142020-01-09 14:02:21 -080084 static_libs: [
85 "framework-wifi-util-lib",
David Su369c9202020-01-09 18:09:56 -080086 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -080087 ],
David Su754fcc22019-09-04 14:31:58 -070088 libs: [
David Su369c9202020-01-09 18:09:56 -080089 "framework-annotations-lib",
90 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
David Su754fcc22019-09-04 14:31:58 -070091 ],
92 srcs: [
93 ":framework-wifi-updatable-sources",
David Su72f9d632020-02-10 15:58:26 -080094 ":framework-wifi-util-lib-aidls",
David Su754fcc22019-09-04 14:31:58 -070095 ],
David Sua6f0c862020-01-21 16:45:50 -080096 // java_api_finder must accompany `srcs`
97 plugins: ["java_api_finder"],
David Su511a8142020-01-09 14:02:21 -080098 installable: false,
99 visibility: [
100 "//frameworks/opt/net/wifi/service",
101 "//frameworks/opt/net/wifi/tests/wifitests",
102 ],
103}
104
105// post-jarjar version of framework-wifi
Paul Duffin52079582020-05-13 20:33:29 +0100106java_sdk_library {
David Su511a8142020-01-09 14:02:21 -0800107 name: "framework-wifi",
David Su27953f12020-06-10 12:39:07 -0700108 defaults: [
109 "framework-module-defaults",
110 "wifi-module-sdk-version-defaults",
111 ],
David Su511a8142020-01-09 14:02:21 -0800112 static_libs: [
Paul Duffin52079582020-05-13 20:33:29 +0100113 "framework-wifi-util-lib",
114 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -0800115 ],
Paul Duffin52079582020-05-13 20:33:29 +0100116 libs: [
117 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
118 ],
119 srcs: [
120 ":framework-wifi-updatable-sources",
121 ":framework-wifi-util-lib-aidls",
122 ],
123
David Su511a8142020-01-09 14:02:21 -0800124 jarjar_rules: ":wifi-jarjar-rules",
125
David Su754fcc22019-09-04 14:31:58 -0700126 installable: true,
127 optimize: {
128 enabled: false
David Su90ed1052019-12-18 18:20:28 -0800129 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900130 hostdex: true, // for hiddenapi check
Paul Duffindde22302020-05-31 11:32:06 +0100131
132 // Allow access to the stubs from anywhere.
133 visibility: ["//visibility:public"],
134
135 // Restrict access to implementation library.
Khanjan Desai581079c2020-05-19 16:14:50 +0530136// impl_library_visibility: [
137// "//visibility:override", // Ignore the visibility property.
138// "//frameworks/opt/net/wifi/service:__subpackages__",
139// ] + test_access_hidden_api_whitelist,
Paul Duffindde22302020-05-31 11:32:06 +0100140
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900141 apex_available: [
142 "com.android.wifi",
143 "test_com.android.wifi",
144 ],
Vladimir Marko8a71e9b2020-03-19 14:30:21 +0000145 permitted_packages: [
146 "android.hardware.wifi",
147 "android.net.wifi",
Paul Duffin407ce9dc2020-05-28 14:55:44 +0100148 // Created by jarjar rules.
149 "com.android.wifi.x",
Vladimir Marko8a71e9b2020-03-19 14:30:21 +0000150 ],
David Su754fcc22019-09-04 14:31:58 -0700151}
152
David Su90ed1052019-12-18 18:20:28 -0800153// defaults for tests that need to build against framework-wifi's @hide APIs
154java_defaults {
155 name: "framework-wifi-test-defaults",
156 sdk_version: "core_platform", // tests can use @CorePlatformApi's
157 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800158 // order matters: classes in framework-wifi are resolved before framework, meaning
159 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
Paul Duffin52079582020-05-13 20:33:29 +0100160 "framework-wifi.impl",
David Succ38e1f2020-01-07 19:47:28 -0800161 "framework",
David Su90ed1052019-12-18 18:20:28 -0800162
163 // if sdk_version="" this gets automatically included, but here we need to add manually.
164 "framework-res",
165 ],
Khanjan Desai581079c2020-05-19 16:14:50 +0530166 visibility: test_access_hidden_api_whitelist,
167}
168
169java_defaults {
170 name: "framework-wifi-vendor-hide-access-defaults",
171 sdk_version: "core_platform", // tests can use @CorePlatformApi's
172 libs: [
173 // order matters: classes in framework-wifi are resolved before framework, meaning
174 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
175 "framework-wifi.impl",
176 "framework",
177
178 // if sdk_version="" this gets automatically included, but here we need to add manually.
179 "framework-res",
180 ],
David Su90ed1052019-12-18 18:20:28 -0800181}
David Su511a8142020-01-09 14:02:21 -0800182
183filegroup {
184 name: "wifi-jarjar-rules",
185 srcs: ["jarjar-rules.txt"],
186}