blob: 44b2a15c1a0e8b5a525b78f8d7e2bb2a27828fea [file] [log] [blame]
Roshan Piusfa486582019-06-11 06:52:01 -07001//
2// Copyright (C) 2018 The Android Open Source Project
Dan Willemsencccec942018-11-16 16:48:19 -08003//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
Roshan Piusfa486582019-06-11 06:52:01 -070015//
16java_defaults {
17 name: "WifiStackCommon",
18 min_sdk_version: "29",
19 platform_apis: true,
20 privileged: true,
21 dex_preopt: {
22 enabled: false,
23 },
24 errorprone: {
25 javacflags: ["-Xep:CheckReturnValue:ERROR"],
26 },
27 product_variables: {
28 pdk: {
29 enabled: false,
30 },
31 },
32 resource_dirs: [
33 "res",
34 ],
35}
Dan Willemsencccec942018-11-16 16:48:19 -080036
37// Make the JNI part
38// ============================================================
39cc_library_shared {
Roshan Piusfa486582019-06-11 06:52:01 -070040 name: "libwifi-jni",
Dan Willemsencccec942018-11-16 16:48:19 -080041
42 cflags: [
43 "-Wall",
44 "-Werror",
45 "-Wextra",
46 "-Wno-unused-parameter",
47 "-Wno-unused-function",
48 "-Wunused-variable",
49 "-Winit-self",
50 "-Wwrite-strings",
51 "-Wshadow",
52 ],
53
54 shared_libs: [
55 "liblog",
56 "libnativehelper",
57 "libcutils",
58 "libutils",
59 "libdl",
60 ],
61
62 srcs: [
63 "jni/com_android_server_wifi_WifiNative.cpp",
64 "jni/jni_helper.cpp",
65 ],
66
67 product_variables: {
68 pdk: {
69 enabled: false,
70 },
71 },
72}
Roshan Piusfa486582019-06-11 06:52:01 -070073
74// Build the wifi-service static library
75// ============================================================
76java_library {
Michael Plassf05826a2019-08-22 17:09:35 -070077 name: "wifi-service",
Roshan Piusfa486582019-06-11 06:52:01 -070078 installable: true,
79 defaults: ["WifiStackCommon"],
Roshan Piusfa486582019-06-11 06:52:01 -070080 srcs: [
Roshan Piusfa486582019-06-11 06:52:01 -070081 "java/**/*.java",
Roshan Piusfa486582019-06-11 06:52:01 -070082 "java/**/*.logtags",
83 ],
84
85 libs: [
David Su35efbb52019-08-28 11:17:41 -070086 "error_prone_annotations",
87 "libprotobuf-java-lite",
88 "jsr305",
Roshan Piusfa486582019-06-11 06:52:01 -070089 "services",
90 ],
91
92 static_libs: [
93 "android.hardware.wifi-V1.0-java",
94 "android.hardware.wifi-V1.1-java",
95 "android.hardware.wifi-V1.2-java",
96 "android.hardware.wifi-V1.3-java",
97 "android.hardware.wifi.hostapd-V1.0-java",
98 "android.hardware.wifi.hostapd-V1.1-java",
99 "android.hardware.wifi.supplicant-V1.0-java",
100 "android.hardware.wifi.supplicant-V1.1-java",
101 "android.hardware.wifi.supplicant-V1.2-java",
102 "android.hidl.manager-V1.2-java",
David Su35efbb52019-08-28 11:17:41 -0700103 "androidx.annotation_annotation",
Roshan Piusfa486582019-06-11 06:52:01 -0700104 "wifi_service_proto",
105 "ksoap2",
106 "libnanohttpd",
David Su35efbb52019-08-28 11:17:41 -0700107 "services.core",
108 "services.net",
109 "services.wifi",
110 "libwificond_aidl-java",
Roshan Piusfa486582019-06-11 06:52:01 -0700111 ],
Roshan Piusfa486582019-06-11 06:52:01 -0700112}
113
114java_defaults {
115 name: "WifiStackAppCommon",
116 defaults: ["WifiStackCommon"],
117 static_libs: [
Michael Plassf05826a2019-08-22 17:09:35 -0700118 "wifi-service",
Roshan Piusfa486582019-06-11 06:52:01 -0700119 ],
120 jni_libs: [
121 "libwifi-jni",
122 ],
Michael Plassf05826a2019-08-22 17:09:35 -0700123 // Resources already included in wifi-service
Roshan Piusfa486582019-06-11 06:52:01 -0700124 resource_dirs: [],
125 jarjar_rules: "jarjar-rules-shared.txt",
126 optimize: {
127 proguard_flags_files: ["proguard.flags"],
128 },
Roshan Pius54584c12019-08-27 12:31:09 -0700129
130 required: [
David Su35efbb52019-08-28 11:17:41 -0700131 "libwifi-jni",
132 "services",
Roshan Pius54584c12019-08-27 12:31:09 -0700133 "cacerts_wfa",
134 ],
Roshan Piusfa486582019-06-11 06:52:01 -0700135}
136
137// Updatable stack packaged as an application
138android_app {
139 name: "WifiStack",
140 defaults: ["WifiStackAppCommon"],
141 certificate: "networkstack",
142 manifest: "AndroidManifest.xml",
143 use_embedded_native_libs: true,
144 // The permission configuration *must* be included to ensure security of the device
145 required: ["WifiStackPermissionConfig"],
146 init_rc: ["wifi.rc"],
147}
148
149// Non-updatable wifi stack running in the system server process for devices not using the module
150// TODO (b/135753701): Test this path.
151android_app {
152 name: "InProcessWifiStack",
153 defaults: ["WifiStackAppCommon"],
154 certificate: "platform",
155 manifest: "AndroidManifest_InProcess.xml",
156 // InProcessWifiStack is a replacement for WifiStack
157 overrides: ["WifiStack"],
158 // The permission configuration *must* be included to ensure security of the device
David Su35efbb52019-08-28 11:17:41 -0700159 required: ["PlatformWifiStackPermissionConfig"],
160 init_rc: ["wifi_inprocess.rc"],
Roshan Piusfa486582019-06-11 06:52:01 -0700161}
162