• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
15java_defaults {
16    name: "wifi-module-sdk-version-defaults",
17    min_sdk_version: "30",
18    target_sdk_version: "30",
19}
20
21filegroup {
22    name: "framework-wifi-updatable-exported-aidl-sources",
23    srcs: ["aidl-export/**/*.aidl"],
24    path: "aidl-export",
25    visibility: ["//visibility:private"],
26}
27
28filegroup {
29    name: "framework-wifi-updatable-java-sources",
30    srcs: [
31        "java/**/*.java",
32        "java/**/*.aidl",
33    ],
34    exclude_srcs: [
35        ":framework-wifi-non-updatable-sources"
36    ],
37    path: "java",
38    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    ],
47}
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.
55        "java/android/net/wifi/SoftApConfToXmlMigrationUtil.java",
56        "java/android/net/wifi/WifiNetworkScoreCache.java",
57        "java/android/net/wifi/WifiMigration.java",
58        "java/android/net/wifi/nl80211/*.java",
59        ":libwificond_ipc_aidl",
60    ],
61}
62
63filegroup {
64    name: "framework-wifi-annotations",
65    srcs: ["java/android/net/wifi/WifiAnnotations.java"],
66}
67
68// 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__",
72
73    "//external/robolectric-shadows:__subpackages__",
74    "//frameworks/base/packages/SettingsLib/tests/integ",
75    "//external/sl4a:__subpackages__",
76]
77
78// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
79// classes before they are renamed.
80java_library {
81    name: "framework-wifi-pre-jarjar",
82    defaults: ["wifi-module-sdk-version-defaults"],
83    sdk_version: "module_current",
84    static_libs: [
85        "framework-wifi-util-lib",
86        "android.hardware.wifi-V1.0-java-constants",
87    ],
88    libs: [
89        "framework-annotations-lib",
90        "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
91    ],
92    srcs: [
93        ":framework-wifi-updatable-sources",
94        ":framework-wifi-util-lib-aidls",
95    ],
96    // java_api_finder must accompany `srcs`
97    plugins: ["java_api_finder"],
98    installable: false,
99    visibility: [
100        "//frameworks/opt/net/wifi/service",
101        "//frameworks/opt/net/wifi/tests/wifitests",
102    ],
103}
104
105// post-jarjar version of framework-wifi
106java_sdk_library {
107    name: "framework-wifi",
108    defaults: [
109        "framework-module-defaults",
110        "wifi-module-sdk-version-defaults",
111    ],
112    static_libs: [
113        "framework-wifi-util-lib",
114        "android.hardware.wifi-V1.0-java-constants",
115    ],
116    libs: [
117        "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
118    ],
119    srcs: [
120        ":framework-wifi-updatable-sources",
121        ":framework-wifi-util-lib-aidls",
122    ],
123
124    jarjar_rules: ":wifi-jarjar-rules",
125
126    installable: true,
127    optimize: {
128        enabled: false
129    },
130    hostdex: true, // for hiddenapi check
131
132    // Allow access to the stubs from anywhere.
133    visibility: ["//visibility:public"],
134
135    // Restrict access to implementation library.
136    impl_library_visibility: [
137        "//visibility:override", // Ignore the visibility property.
138        "//frameworks/opt/net/wifi/service:__subpackages__",
139    ] + test_access_hidden_api_whitelist,
140
141    apex_available: [
142        "com.android.wifi",
143        "test_com.android.wifi",
144    ],
145    permitted_packages: [
146        "android.hardware.wifi",
147        "android.net.wifi",
148        // Created by jarjar rules.
149        "com.android.wifi.x",
150    ],
151}
152
153// defaults for tests that need to build against framework-wifi's @hide APIs
154java_defaults {
155    name: "framework-wifi-test-defaults",
156    sdk_version: "core_platform", // tests can use @CorePlatformApi's
157    libs: [
158        // order matters: classes in framework-wifi are resolved before framework, meaning
159        // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
160        "framework-wifi.impl",
161        "framework",
162
163        // if sdk_version="" this gets automatically included, but here we need to add manually.
164        "framework-res",
165    ],
166    visibility: test_access_hidden_api_whitelist,
167}
168
169filegroup {
170    name: "wifi-jarjar-rules",
171    srcs: ["jarjar-rules.txt"],
172}
173