1// 2// Copyright (C) 2018 The Android Open Source Project 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. 15// 16package { 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20java_defaults { 21 name: "wifi-service-common", 22 defaults: ["wifi-module-sdk-version-defaults"], 23 errorprone: { 24 javacflags: ["-Xep:CheckReturnValue:ERROR"], 25 }, 26 product_variables: { 27 pdk: { 28 enabled: false, 29 }, 30 }, 31} 32 33filegroup { 34 name: "wifi-service-srcs", 35 srcs: [ 36 "java/**/*.java", 37 "java/**/*.logtags", 38 ":framework-wifi-service-shared-srcs", 39 ":net-utils-wifi-service-common-srcs", 40 ":statslog-wifi-java-gen", 41 ":coex-table-parser", 42 ], 43} 44 45filegroup { 46 name: "wifi-service-BaseWifiService", 47 srcs: ["java/com/android/server/wifi/BaseWifiService.java"], 48 path: "java", 49} 50 51// pre-jarjar version of wifi-service that builds against pre-jarjar version of framework-wifi 52java_library { 53 name: "wifi-service-pre-jarjar", 54 installable: false, 55 defaults: ["wifi-service-common"], 56 srcs: [ ":wifi-service-srcs" ], 57 // java_api_finder must accompany `srcs` 58 plugins: ["java_api_finder"], 59 60 sdk_version: "system_server_current", 61 lint: { 62 baseline_filename: "lint-baseline-pre-jarjar.xml", 63 strict_updatability_linting: true, 64 }, 65 libs: [ 66 "error_prone_annotations", 67 "jsr305", 68 "framework-annotations-lib", 69 // load the resources from the resources APK. 70 "ServiceWifiResources", 71 // need pre-jarjar symbols so that wifi-service can reference the original class names at 72 // compile time 73 "framework-wifi-pre-jarjar", 74 "framework-connectivity.stubs.module_lib", 75 "framework-statsd.stubs.module_lib", 76 "framework-tethering.stubs.module_lib", 77 "unsupportedappusage", 78 ], 79 80 static_libs: [ 81 "android.hardware.wifi-V1.0-java", 82 "android.hardware.wifi-V1.1-java", 83 "android.hardware.wifi-V1.2-java", 84 "android.hardware.wifi-V1.3-java", 85 "android.hardware.wifi-V1.4-java", 86 "android.hardware.wifi-V1.5-java", 87 "android.hardware.wifi.hostapd-V1.0-java", 88 "android.hardware.wifi.hostapd-V1.1-java", 89 "android.hardware.wifi.hostapd-V1.2-java", 90 "android.hardware.wifi.hostapd-V1.3-java", 91 "android.hardware.wifi.supplicant-V1.0-java", 92 "android.hardware.wifi.supplicant-V1.1-java", 93 "android.hardware.wifi.supplicant-V1.2-java", 94 "android.hardware.wifi.supplicant-V1.3-java", 95 "android.hardware.wifi.supplicant-V1.4-java", 96 "android.hidl.manager-V1.2-java", 97 "androidx.annotation_annotation", 98 "bouncycastle-unbundled", 99 "ksoap2", 100 // Note: libprotobuf-java-lite uses a few core platform APIs which 101 // does show up as @hide API usage. But, this can be safely ignored 102 // since the library uses reflection to ensure that the OS does provide 103 // the necessary core platform APIs. 104 "libprotobuf-java-lite", 105 "libnanohttpd", 106 "services.net-module-wifi", 107 "wifi-lite-protos", 108 "wifi-nano-protos", 109 ], 110} 111 112// wifi-service static library 113// ============================================================ 114java_library { 115 name: "service-wifi", 116 defaults: ["wifi-service-common"], 117 installable: true, 118 static_libs: ["wifi-service-pre-jarjar"], 119 120 // need to include `libs` so that Soong doesn't complain about missing classes after jarjaring 121 libs: [ 122 "framework-wifi.impl", 123 ], 124 125 sdk_version: "system_server_current", 126 127 jarjar_rules: ":wifi-jarjar-rules", 128 optimize: { 129 enabled: true, 130 shrink: true, 131 proguard_flags_files: ["proguard.flags"], 132 }, 133 dex_preopt: { 134 enabled: false, 135 app_image: false, 136 }, 137 138 visibility: [ 139 "//frameworks/opt/net/wifi/service/apex", 140 "//frameworks/opt/net/wifi/tests/wifitests/apex", 141 "//packages/modules/Wifi/apex", 142 "//packages/modules/Wifi/service/tests/wifitests/apex", 143 ], 144 apex_available: [ 145 "com.android.wifi", 146 "test_com.android.wifi", 147 ], 148} 149 150// Statsd auto-generated code 151// ============================================================ 152genrule { 153 name: "statslog-wifi-java-gen", 154 tools: ["stats-log-api-gen"], 155 cmd: "$(location stats-log-api-gen) --java $(out) --module wifi " + 156 " --javaPackage com.android.server.wifi.proto --javaClass WifiStatsLog" + 157 " --minApiLevel 30", 158 out: ["com/android/server/wifi/proto/WifiStatsLog.java"], 159} 160 161// Prebuilt for the wifi.rc file. 162prebuilt_etc { 163 name: "wifi.rc", 164 src: "wifi.rc", 165 sub_dir: "init" 166} 167