blob: 180368cbd9f765ddc556ed0b6723fc3a333087af [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
15
16filegroup {
17 name: "framework-wifi-updatable-sources",
18 srcs: [
19 "java/**/*.java",
20 "java/**/*.aidl",
21 ],
22 exclude_srcs: [
23 ":framework-wifi-non-updatable-sources"
24 ],
25 path: "java",
26}
27
28filegroup {
29 name: "framework-wifi-non-updatable-sources",
30 srcs: [
31 // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and
32 // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache
33 // to a separate package.
34 "java/android/net/wifi/WifiNetworkScoreCache.java",
David Su754fcc22019-09-04 14:31:58 -070035 "java/android/net/wifi/wificond/*.java",
36 ":libwificond_ipc_aidl",
37 ],
38}
39
David Su130441b2019-12-14 21:37:20 -080040filegroup {
41 name: "framework-wifi-annotations",
42 srcs: ["java/android/net/wifi/WifiAnnotations.java"],
43}
44
David Su90ed1052019-12-18 18:20:28 -080045// list of tests that are allowed to access @hide APIs from framework-wifi
46test_access_hidden_api_whitelist = [
47 "//frameworks/base/wifi/tests",
48 "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
David Su434fe602019-12-18 21:22:21 -080049
David Sufd0886a2019-12-18 21:56:46 -080050 "//frameworks/opt/net/wifi/libs/WifiTrackerLib/tests",
David Su4c5bab62020-01-07 13:01:30 -080051 "//external/robolectric-shadows:__subpackages__",
David Su90ed1052019-12-18 18:20:28 -080052]
53
David Su754fcc22019-09-04 14:31:58 -070054java_library {
55 name: "framework-wifi",
David Su90ed1052019-12-18 18:20:28 -080056 // TODO(b/140299412) should be core_current once we build against framework-system-stubs
57 sdk_version: "core_platform",
David Su754fcc22019-09-04 14:31:58 -070058 libs: [
David Su90ed1052019-12-18 18:20:28 -080059 // TODO(b/140299412) should be framework-system-stubs once we fix all @hide dependencies
60 "framework-minus-apex",
Artur Satayev74cb7192019-12-10 17:47:56 +000061 "unsupportedappusage",
David Su754fcc22019-09-04 14:31:58 -070062 ],
63 srcs: [
64 ":framework-wifi-updatable-sources",
65 ],
66 installable: true,
67 optimize: {
68 enabled: false
David Su90ed1052019-12-18 18:20:28 -080069 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +090070 hostdex: true, // for hiddenapi check
David Su90ed1052019-12-18 18:20:28 -080071 visibility: [
72 "//frameworks/base", // TODO(b/140299412) remove once all dependencies are fixed
73 "//frameworks/opt/net/wifi/service:__subpackages__",
74 ] + test_access_hidden_api_whitelist,
Jiyong Parkc81df3f2020-01-06 13:30:59 +090075 apex_available: [
76 "com.android.wifi",
77 "test_com.android.wifi",
78 ],
David Suae86a372020-01-03 14:26:11 -080079 plugins: ["java_api_finder"],
David Su754fcc22019-09-04 14:31:58 -070080}
81
David Su754fcc22019-09-04 14:31:58 -070082droidstubs {
83 name: "framework-wifi-stubs-srcs",
84 srcs: [
85 ":framework-annotations",
86 ":framework-wifi-updatable-sources",
87 ],
88 aidl: {
89 include_dirs: ["frameworks/base/core/java"],
90 },
Anton Hansson0c2ebe22019-12-17 10:03:52 +000091 defaults: [ "framework-module-stubs-defaults-systemapi" ],
David Su754fcc22019-09-04 14:31:58 -070092 sdk_version: "core_current",
93 libs: ["android_system_stubs_current"],
94}
95
96java_library {
97 name: "framework-wifi-stubs",
98 srcs: [":framework-wifi-stubs-srcs"],
99 aidl: {
100 export_include_dirs: [
101 "java",
102 ],
103 },
104 sdk_version: "core_current",
105 libs: ["android_system_stubs_current"],
106 installable: false,
107}
108
David Su90ed1052019-12-18 18:20:28 -0800109// defaults for tests that need to build against framework-wifi's @hide APIs
110java_defaults {
111 name: "framework-wifi-test-defaults",
112 sdk_version: "core_platform", // tests can use @CorePlatformApi's
113 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800114 // order matters: classes in framework-wifi are resolved before framework, meaning
115 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
David Su90ed1052019-12-18 18:20:28 -0800116 "framework-wifi",
David Succ38e1f2020-01-07 19:47:28 -0800117 "framework",
David Su90ed1052019-12-18 18:20:28 -0800118
119 // if sdk_version="" this gets automatically included, but here we need to add manually.
120 "framework-res",
121 ],
122 visibility: test_access_hidden_api_whitelist,
123}