blob: 8fc8af980f9ecf7e054f4adcf4bcc2f79e1f6391 [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 Pius9dc9aff2020-01-09 09:06:29 -080050 "java/android/net/wifi/WifiOemConfigStoreMigrationHook.java",
David Su754fcc22019-09-04 14:31:58 -070051 "java/android/net/wifi/wificond/*.java",
52 ":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 Sufd0886a2019-12-18 21:56:46 -080066 "//frameworks/opt/net/wifi/libs/WifiTrackerLib/tests",
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 Su439175f2020-01-17 21:16:31 +000076 // TODO(b/146757305): sdk_version should be "module_lib_current"
77 sdk_version: "core_current",
David Su511a8142020-01-09 14:02:21 -080078 static_libs: [
79 "framework-wifi-util-lib",
David Su369c9202020-01-09 18:09:56 -080080 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -080081 ],
David Su754fcc22019-09-04 14:31:58 -070082 libs: [
David Su369c9202020-01-09 18:09:56 -080083 "framework-annotations-lib",
84 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
85 "unsupportedappusage-annotation", // for dalvik.annotation.compat.UnsupportedAppUsage
Chen Xu546ce5e2020-01-10 08:38:31 -080086 "framework-telephony-stubs",
David Su439175f2020-01-17 21:16:31 +000087 // TODO(b/146757305): should be unnecessary once
88 // sdk_version="module_lib_current"
89 "android_system_stubs_current",
David Su754fcc22019-09-04 14:31:58 -070090 ],
91 srcs: [
92 ":framework-wifi-updatable-sources",
93 ],
David Su511a8142020-01-09 14:02:21 -080094 installable: false,
95 visibility: [
96 "//frameworks/opt/net/wifi/service",
97 "//frameworks/opt/net/wifi/tests/wifitests",
98 ],
David Su439175f2020-01-17 21:16:31 +000099
100 // TODO(b/146757305): should be unnecessary once
101 // sdk_version="module_lib_current"
102 aidl: {
103 include_dirs: [
104 "frameworks/base/core/java",
105 ],
106 },
David Su511a8142020-01-09 14:02:21 -0800107}
108
109// post-jarjar version of framework-wifi
110java_library {
111 name: "framework-wifi",
David Su439175f2020-01-17 21:16:31 +0000112 // TODO(b/146757305): sdk_version should be "module_lib_current"
113 sdk_version: "core_current",
David Su511a8142020-01-09 14:02:21 -0800114 static_libs: [
115 "framework-wifi-pre-jarjar",
116 ],
117 jarjar_rules: ":wifi-jarjar-rules",
118
David Su754fcc22019-09-04 14:31:58 -0700119 installable: true,
120 optimize: {
121 enabled: false
David Su90ed1052019-12-18 18:20:28 -0800122 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900123 hostdex: true, // for hiddenapi check
David Su90ed1052019-12-18 18:20:28 -0800124 visibility: [
David Su90ed1052019-12-18 18:20:28 -0800125 "//frameworks/opt/net/wifi/service:__subpackages__",
126 ] + test_access_hidden_api_whitelist,
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900127 apex_available: [
128 "com.android.wifi",
129 "test_com.android.wifi",
130 ],
David Suae86a372020-01-03 14:26:11 -0800131 plugins: ["java_api_finder"],
David Su754fcc22019-09-04 14:31:58 -0700132}
133
David Su754fcc22019-09-04 14:31:58 -0700134droidstubs {
135 name: "framework-wifi-stubs-srcs",
136 srcs: [
137 ":framework-annotations",
138 ":framework-wifi-updatable-sources",
139 ],
David Suc6513592020-01-15 22:55:20 +0000140 // This is needed as IOnWifiActivityEnergyInfoListener.aidl in framework-wifi depends on
141 // WifiActivityEnergyInfo.aidl in framework-minus-apex
David Su754fcc22019-09-04 14:31:58 -0700142 aidl: {
143 include_dirs: ["frameworks/base/core/java"],
144 },
Anton Hansson0c2ebe22019-12-17 10:03:52 +0000145 defaults: [ "framework-module-stubs-defaults-systemapi" ],
David Su754fcc22019-09-04 14:31:58 -0700146 sdk_version: "core_current",
147 libs: ["android_system_stubs_current"],
148}
149
150java_library {
151 name: "framework-wifi-stubs",
152 srcs: [":framework-wifi-stubs-srcs"],
David Su754fcc22019-09-04 14:31:58 -0700153 sdk_version: "core_current",
154 libs: ["android_system_stubs_current"],
155 installable: false,
156}
157
David Su90ed1052019-12-18 18:20:28 -0800158// defaults for tests that need to build against framework-wifi's @hide APIs
159java_defaults {
160 name: "framework-wifi-test-defaults",
161 sdk_version: "core_platform", // tests can use @CorePlatformApi's
162 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800163 // order matters: classes in framework-wifi are resolved before framework, meaning
164 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
David Su90ed1052019-12-18 18:20:28 -0800165 "framework-wifi",
David Succ38e1f2020-01-07 19:47:28 -0800166 "framework",
David Su90ed1052019-12-18 18:20:28 -0800167
168 // if sdk_version="" this gets automatically included, but here we need to add manually.
169 "framework-res",
170 ],
171 visibility: test_access_hidden_api_whitelist,
172}
David Su511a8142020-01-09 14:02:21 -0800173
174filegroup {
175 name: "wifi-jarjar-rules",
176 srcs: ["jarjar-rules.txt"],
177}