blob: 2f9979453f387ebca317b3c87c9b44a9941d8cf6 [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 Su6c00e382020-01-06 15:24:42 -080053 "//frameworks/base/packages/SettingsLib/tests/integ",
David Su812a8f12020-01-11 16:22:00 -080054 "//external/sl4a:__subpackages__",
David Su90ed1052019-12-18 18:20:28 -080055]
56
David Su511a8142020-01-09 14:02:21 -080057// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
58// classes before they are renamed.
David Su754fcc22019-09-04 14:31:58 -070059java_library {
David Su511a8142020-01-09 14:02:21 -080060 name: "framework-wifi-pre-jarjar",
David Su439175f2020-01-17 21:16:31 +000061 // TODO(b/146757305): sdk_version should be "module_lib_current"
62 sdk_version: "core_current",
David Su511a8142020-01-09 14:02:21 -080063 static_libs: [
64 "framework-wifi-util-lib",
David Su369c9202020-01-09 18:09:56 -080065 "android.hardware.wifi-V1.0-java-constants",
David Su511a8142020-01-09 14:02:21 -080066 ],
David Su754fcc22019-09-04 14:31:58 -070067 libs: [
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
Chen Xu546ce5e2020-01-10 08:38:31 -080071 "framework-telephony-stubs",
David Su439175f2020-01-17 21:16:31 +000072 // TODO(b/146757305): should be unnecessary once
73 // sdk_version="module_lib_current"
74 "android_system_stubs_current",
David Su754fcc22019-09-04 14:31:58 -070075 ],
76 srcs: [
77 ":framework-wifi-updatable-sources",
78 ],
David Su511a8142020-01-09 14:02:21 -080079 installable: false,
80 visibility: [
81 "//frameworks/opt/net/wifi/service",
82 "//frameworks/opt/net/wifi/tests/wifitests",
83 ],
David Su439175f2020-01-17 21:16:31 +000084
85 // TODO(b/146757305): should be unnecessary once
86 // sdk_version="module_lib_current"
87 aidl: {
88 include_dirs: [
89 "frameworks/base/core/java",
90 ],
91 },
David Su511a8142020-01-09 14:02:21 -080092}
93
94// post-jarjar version of framework-wifi
95java_library {
96 name: "framework-wifi",
David Su439175f2020-01-17 21:16:31 +000097 // TODO(b/146757305): sdk_version should be "module_lib_current"
98 sdk_version: "core_current",
David Su511a8142020-01-09 14:02:21 -080099 static_libs: [
100 "framework-wifi-pre-jarjar",
101 ],
102 jarjar_rules: ":wifi-jarjar-rules",
103
David Su754fcc22019-09-04 14:31:58 -0700104 installable: true,
105 optimize: {
106 enabled: false
David Su90ed1052019-12-18 18:20:28 -0800107 },
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900108 hostdex: true, // for hiddenapi check
David Su90ed1052019-12-18 18:20:28 -0800109 visibility: [
David Suc865b212020-01-16 02:43:21 +0000110 "//frameworks/base", // TODO(b/140299412) remove once all dependencies are fixed
David Su90ed1052019-12-18 18:20:28 -0800111 "//frameworks/opt/net/wifi/service:__subpackages__",
112 ] + test_access_hidden_api_whitelist,
Jiyong Parkc81df3f2020-01-06 13:30:59 +0900113 apex_available: [
114 "com.android.wifi",
115 "test_com.android.wifi",
116 ],
David Suae86a372020-01-03 14:26:11 -0800117 plugins: ["java_api_finder"],
David Su754fcc22019-09-04 14:31:58 -0700118}
119
David Su754fcc22019-09-04 14:31:58 -0700120droidstubs {
121 name: "framework-wifi-stubs-srcs",
122 srcs: [
123 ":framework-annotations",
124 ":framework-wifi-updatable-sources",
125 ],
David Suc6513592020-01-15 22:55:20 +0000126 // This is needed as IOnWifiActivityEnergyInfoListener.aidl in framework-wifi depends on
127 // WifiActivityEnergyInfo.aidl in framework-minus-apex
David Su754fcc22019-09-04 14:31:58 -0700128 aidl: {
129 include_dirs: ["frameworks/base/core/java"],
130 },
Anton Hansson0c2ebe22019-12-17 10:03:52 +0000131 defaults: [ "framework-module-stubs-defaults-systemapi" ],
David Su754fcc22019-09-04 14:31:58 -0700132 sdk_version: "core_current",
133 libs: ["android_system_stubs_current"],
134}
135
136java_library {
137 name: "framework-wifi-stubs",
138 srcs: [":framework-wifi-stubs-srcs"],
David Su754fcc22019-09-04 14:31:58 -0700139 sdk_version: "core_current",
140 libs: ["android_system_stubs_current"],
141 installable: false,
142}
143
David Su90ed1052019-12-18 18:20:28 -0800144// defaults for tests that need to build against framework-wifi's @hide APIs
145java_defaults {
146 name: "framework-wifi-test-defaults",
147 sdk_version: "core_platform", // tests can use @CorePlatformApi's
148 libs: [
David Succ38e1f2020-01-07 19:47:28 -0800149 // order matters: classes in framework-wifi are resolved before framework, meaning
150 // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
David Su90ed1052019-12-18 18:20:28 -0800151 "framework-wifi",
David Succ38e1f2020-01-07 19:47:28 -0800152 "framework",
David Su90ed1052019-12-18 18:20:28 -0800153
154 // if sdk_version="" this gets automatically included, but here we need to add manually.
155 "framework-res",
156 ],
157 visibility: test_access_hidden_api_whitelist,
158}
David Su511a8142020-01-09 14:02:21 -0800159
160filegroup {
161 name: "wifi-jarjar-rules",
162 srcs: ["jarjar-rules.txt"],
163}