blob: 6326f14bc6fdc8c92dac27a2db0f488c37bc50fe [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",
Roshan Pius9dc9aff2020-01-09 09:06:29 -080035 "java/android/net/wifi/WifiOemConfigStoreMigrationHook.java",
David Su754fcc22019-09-04 14:31:58 -070036 "java/android/net/wifi/wificond/*.java",
37 ":libwificond_ipc_aidl",
38 ],
39}
40
David Su130441b2019-12-14 21:37:20 -080041filegroup {
42 name: "framework-wifi-annotations",
43 srcs: ["java/android/net/wifi/WifiAnnotations.java"],
44}
45
David Su90ed1052019-12-18 18:20:28 -080046// list of tests that are allowed to access @hide APIs from framework-wifi
47test_access_hidden_api_whitelist = [
48 "//frameworks/base/wifi/tests",
49 "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
David Su434fe602019-12-18 21:22:21 -080050
David Sufd0886a2019-12-18 21:56:46 -080051 "//frameworks/opt/net/wifi/libs/WifiTrackerLib/tests",
David Su4c5bab62020-01-07 13:01:30 -080052 "//external/robolectric-shadows:__subpackages__",
David Su90ed1052019-12-18 18:20:28 -080053]
54
David Su511a8142020-01-09 14:02:21 -080055// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
56// classes before they are renamed.
David Su754fcc22019-09-04 14:31:58 -070057java_library {
David Su511a8142020-01-09 14:02:21 -080058 name: "framework-wifi-pre-jarjar",
David Su90ed1052019-12-18 18:20:28 -080059 // TODO(b/140299412) should be core_current once we build against framework-system-stubs
60 sdk_version: "core_platform",
David Su511a8142020-01-09 14:02:21 -080061 static_libs: [
62 "framework-wifi-util-lib",
David Su369c9202020-01-09 18:09:56 -080063 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -080064 ],
David Su754fcc22019-09-04 14:31:58 -070065 libs: [
David Su90ed1052019-12-18 18:20:28 -080066 // TODO(b/140299412) should be framework-system-stubs once we fix all @hide dependencies
67 "framework-minus-apex",
David Su369c9202020-01-09 18:09:56 -080068 "framework-annotations-lib",
69 "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
70 "unsupportedappusage-annotation", // for dalvik.annotation.compat.UnsupportedAppUsage
David Su754fcc22019-09-04 14:31:58 -070071 ],
72 srcs: [
73 ":framework-wifi-updatable-sources",
74 ],
David Su511a8142020-01-09 14:02:21 -080075 installable: false,
76 visibility: [
77 "//frameworks/opt/net/wifi/service",
78 "//frameworks/opt/net/wifi/tests/wifitests",
79 ],
80}
81
82// post-jarjar version of framework-wifi
83java_library {
84 name: "framework-wifi",
85 // TODO(b/140299412) should be core_current once we build against framework-system-stubs
86 sdk_version: "core_platform",
87 static_libs: [
88 "framework-wifi-pre-jarjar",
89 ],
90 jarjar_rules: ":wifi-jarjar-rules",
91
David Su754fcc22019-09-04 14:31:58 -070092 installable: true,
93 optimize: {
94 enabled: false
David Su90ed1052019-12-18 18:20:28 -080095 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +090096 hostdex: true, // for hiddenapi check
David Su90ed1052019-12-18 18:20:28 -080097 visibility: [
98 "//frameworks/base", // TODO(b/140299412) remove once all dependencies are fixed
99 "//frameworks/opt/net/wifi/service:__subpackages__",
100 ] + test_access_hidden_api_whitelist,
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900101 apex_available: [
102 "com.android.wifi",
103 "test_com.android.wifi",
104 ],
David Suae86a372020-01-03 14:26:11 -0800105 plugins: ["java_api_finder"],
David Su754fcc22019-09-04 14:31:58 -0700106}
107
David Su754fcc22019-09-04 14:31:58 -0700108droidstubs {
109 name: "framework-wifi-stubs-srcs",
110 srcs: [
111 ":framework-annotations",
112 ":framework-wifi-updatable-sources",
113 ],
114 aidl: {
115 include_dirs: ["frameworks/base/core/java"],
116 },
Anton Hansson0c2ebe22019-12-17 10:03:52 +0000117 defaults: [ "framework-module-stubs-defaults-systemapi" ],
David Su754fcc22019-09-04 14:31:58 -0700118 sdk_version: "core_current",
119 libs: ["android_system_stubs_current"],
120}
121
122java_library {
123 name: "framework-wifi-stubs",
124 srcs: [":framework-wifi-stubs-srcs"],
125 aidl: {
126 export_include_dirs: [
127 "java",
128 ],
129 },
130 sdk_version: "core_current",
131 libs: ["android_system_stubs_current"],
132 installable: false,
133}
134
David Su90ed1052019-12-18 18:20:28 -0800135// defaults for tests that need to build against framework-wifi's @hide APIs
136java_defaults {
137 name: "framework-wifi-test-defaults",
138 sdk_version: "core_platform", // tests can use @CorePlatformApi's
139 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800140 // order matters: classes in framework-wifi are resolved before framework, meaning
141 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
David Su90ed1052019-12-18 18:20:28 -0800142 "framework-wifi",
David Succ38e1f2020-01-07 19:47:28 -0800143 "framework",
David Su90ed1052019-12-18 18:20:28 -0800144
145 // if sdk_version="" this gets automatically included, but here we need to add manually.
146 "framework-res",
147 ],
148 visibility: test_access_hidden_api_whitelist,
149}
David Su511a8142020-01-09 14:02:21 -0800150
151filegroup {
152 name: "wifi-jarjar-rules",
153 srcs: ["jarjar-rules.txt"],
154}