blob: 1cc5073c5f719698b41a2f0c66425eb36bc3298e [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__",
Anton Hansson0dc853e2020-07-21 10:20:06 +010076 "//packages/apps/Settings/tests/robotests", // TODO(b/161767237): remove
David Su90ed1052019-12-18 18:20:28 -080077]
78
David Su511a8142020-01-09 14:02:21 -080079// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
80// classes before they are renamed.
David Su754fcc22019-09-04 14:31:58 -070081java_library {
David Su511a8142020-01-09 14:02:21 -080082 name: "framework-wifi-pre-jarjar",
David Su27953f12020-06-10 12:39:07 -070083 defaults: ["wifi-module-sdk-version-defaults"],
David Su3c0d1972020-03-16 15:53:48 -070084 sdk_version: "module_current",
David Su511a8142020-01-09 14:02:21 -080085 static_libs: [
86 "framework-wifi-util-lib",
David Su369c9202020-01-09 18:09:56 -080087 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -080088 ],
David Su754fcc22019-09-04 14:31:58 -070089 libs: [
David Su369c9202020-01-09 18:09:56 -080090 "framework-annotations-lib",
91 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
David Su754fcc22019-09-04 14:31:58 -070092 ],
93 srcs: [
94 ":framework-wifi-updatable-sources",
David Su72f9d632020-02-10 15:58:26 -080095 ":framework-wifi-util-lib-aidls",
David Su754fcc22019-09-04 14:31:58 -070096 ],
David Sua6f0c862020-01-21 16:45:50 -080097 // java_api_finder must accompany `srcs`
98 plugins: ["java_api_finder"],
David Su511a8142020-01-09 14:02:21 -080099 installable: false,
100 visibility: [
101 "//frameworks/opt/net/wifi/service",
102 "//frameworks/opt/net/wifi/tests/wifitests",
103 ],
104}
105
106// post-jarjar version of framework-wifi
Paul Duffin52079582020-05-13 20:33:29 +0100107java_sdk_library {
David Su511a8142020-01-09 14:02:21 -0800108 name: "framework-wifi",
David Su27953f12020-06-10 12:39:07 -0700109 defaults: [
110 "framework-module-defaults",
111 "wifi-module-sdk-version-defaults",
112 ],
David Su511a8142020-01-09 14:02:21 -0800113 static_libs: [
Paul Duffin52079582020-05-13 20:33:29 +0100114 "framework-wifi-util-lib",
115 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -0800116 ],
Paul Duffin52079582020-05-13 20:33:29 +0100117 libs: [
118 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
119 ],
120 srcs: [
121 ":framework-wifi-updatable-sources",
122 ":framework-wifi-util-lib-aidls",
123 ],
124
David Su511a8142020-01-09 14:02:21 -0800125 jarjar_rules: ":wifi-jarjar-rules",
126
David Su754fcc22019-09-04 14:31:58 -0700127 installable: true,
128 optimize: {
129 enabled: false
David Su90ed1052019-12-18 18:20:28 -0800130 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900131 hostdex: true, // for hiddenapi check
Paul Duffindde22302020-05-31 11:32:06 +0100132
Paul Duffindde22302020-05-31 11:32:06 +0100133 // Restrict access to implementation library.
134 impl_library_visibility: [
David Su90ed1052019-12-18 18:20:28 -0800135 "//frameworks/opt/net/wifi/service:__subpackages__",
136 ] + test_access_hidden_api_whitelist,
Paul Duffindde22302020-05-31 11:32:06 +0100137
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900138 apex_available: [
139 "com.android.wifi",
140 "test_com.android.wifi",
141 ],
Vladimir Marko8a71e9b2020-03-19 14:30:21 +0000142 permitted_packages: [
143 "android.hardware.wifi",
144 "android.net.wifi",
Paul Duffin407ce9dc2020-05-28 14:55:44 +0100145 // Created by jarjar rules.
146 "com.android.wifi.x",
Vladimir Marko8a71e9b2020-03-19 14:30:21 +0000147 ],
David Su754fcc22019-09-04 14:31:58 -0700148}
149
David Su90ed1052019-12-18 18:20:28 -0800150// defaults for tests that need to build against framework-wifi's @hide APIs
151java_defaults {
152 name: "framework-wifi-test-defaults",
153 sdk_version: "core_platform", // tests can use @CorePlatformApi's
154 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800155 // order matters: classes in framework-wifi are resolved before framework, meaning
156 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
Paul Duffin52079582020-05-13 20:33:29 +0100157 "framework-wifi.impl",
David Succ38e1f2020-01-07 19:47:28 -0800158 "framework",
David Su90ed1052019-12-18 18:20:28 -0800159
160 // if sdk_version="" this gets automatically included, but here we need to add manually.
161 "framework-res",
162 ],
163 visibility: test_access_hidden_api_whitelist,
164}
David Su511a8142020-01-09 14:02:21 -0800165
166filegroup {
167 name: "wifi-jarjar-rules",
168 srcs: ["jarjar-rules.txt"],
169}