Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2018 The Android Open Source Project |
Dan Willemsen | cccec94 | 2018-11-16 16:48:19 -0800 | [diff] [blame] | 3 | // |
| 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 Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 15 | // |
| 16 | java_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 Willemsen | cccec94 | 2018-11-16 16:48:19 -0800 | [diff] [blame] | 36 | |
| 37 | // Make the JNI part |
| 38 | // ============================================================ |
| 39 | cc_library_shared { |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 40 | name: "libwifi-jni", |
Dan Willemsen | cccec94 | 2018-11-16 16:48:19 -0800 | [diff] [blame] | 41 | |
| 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 Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 73 | |
| 74 | // Build the wifi-service static library |
| 75 | // ============================================================ |
| 76 | java_library { |
Michael Plass | f05826a | 2019-08-22 17:09:35 -0700 | [diff] [blame] | 77 | name: "wifi-service", |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 78 | installable: true, |
| 79 | defaults: ["WifiStackCommon"], |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 80 | srcs: [ |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 81 | "java/**/*.java", |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 82 | "java/**/*.logtags", |
| 83 | ], |
| 84 | |
| 85 | libs: [ |
David Su | 35efbb5 | 2019-08-28 11:17:41 -0700 | [diff] [blame^] | 86 | "error_prone_annotations", |
| 87 | "libprotobuf-java-lite", |
| 88 | "jsr305", |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 89 | "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 Su | 35efbb5 | 2019-08-28 11:17:41 -0700 | [diff] [blame^] | 103 | "androidx.annotation_annotation", |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 104 | "wifi_service_proto", |
| 105 | "ksoap2", |
| 106 | "libnanohttpd", |
David Su | 35efbb5 | 2019-08-28 11:17:41 -0700 | [diff] [blame^] | 107 | "services.core", |
| 108 | "services.net", |
| 109 | "services.wifi", |
| 110 | "libwificond_aidl-java", |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 111 | ], |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | java_defaults { |
| 115 | name: "WifiStackAppCommon", |
| 116 | defaults: ["WifiStackCommon"], |
| 117 | static_libs: [ |
Michael Plass | f05826a | 2019-08-22 17:09:35 -0700 | [diff] [blame] | 118 | "wifi-service", |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 119 | ], |
| 120 | jni_libs: [ |
| 121 | "libwifi-jni", |
| 122 | ], |
Michael Plass | f05826a | 2019-08-22 17:09:35 -0700 | [diff] [blame] | 123 | // Resources already included in wifi-service |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 124 | resource_dirs: [], |
| 125 | jarjar_rules: "jarjar-rules-shared.txt", |
| 126 | optimize: { |
| 127 | proguard_flags_files: ["proguard.flags"], |
| 128 | }, |
Roshan Pius | 54584c1 | 2019-08-27 12:31:09 -0700 | [diff] [blame] | 129 | |
| 130 | required: [ |
David Su | 35efbb5 | 2019-08-28 11:17:41 -0700 | [diff] [blame^] | 131 | "libwifi-jni", |
| 132 | "services", |
Roshan Pius | 54584c1 | 2019-08-27 12:31:09 -0700 | [diff] [blame] | 133 | "cacerts_wfa", |
| 134 | ], |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | // Updatable stack packaged as an application |
| 138 | android_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. |
| 151 | android_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 Su | 35efbb5 | 2019-08-28 11:17:41 -0700 | [diff] [blame^] | 159 | required: ["PlatformWifiStackPermissionConfig"], |
| 160 | init_rc: ["wifi_inprocess.rc"], |
Roshan Pius | fa48658 | 2019-06-11 06:52:01 -0700 | [diff] [blame] | 161 | } |
| 162 | |