• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2022 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
15package {
16    default_team: "trendy_team_fwk_wifi_hal",
17    default_applicable_licenses: ["hardware_interfaces_license"],
18}
19
20soong_config_module_type {
21    name: "wifi_hal_cc_defaults",
22    module_type: "cc_defaults",
23    config_namespace: "wifi",
24    bool_variables: [
25        "hidl_feature_aware", // WIFI_HIDL_FEATURE_AWARE
26        "hidl_feature_dual_interface", // WIFI_HIDL_FEATURE_DUAL_INTERFACE
27        "hidl_feature_disable_ap", // WIFI_HIDL_FEATURE_DISABLE_AP
28        "hidl_feature_disable_ap_mac_randomization", // WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION
29        "avoid_iface_reset_mac_change", // WIFI_AVOID_IFACE_RESET_MAC_CHANGE
30        "wifi_skip_state_toggle_off_on_for_nan", // WIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN
31    ],
32    value_variables: [
33        "hal_interface_combinations", // WIFI_HAL_INTERFACE_COMBINATIONS
34    ],
35    properties: [
36        "cppflags",
37    ],
38}
39
40wifi_hal_cc_defaults {
41    name: "android.hardware.wifi-service-cppflags-defaults",
42    soong_config_variables: {
43        hidl_feature_aware: {
44            cppflags: ["-DWIFI_HIDL_FEATURE_AWARE"],
45        },
46        hidl_feature_dual_interface: {
47            cppflags: ["-DWIFI_HIDL_FEATURE_DUAL_INTERFACE"],
48        },
49        hidl_feature_disable_ap: {
50            cppflags: ["-DWIFI_HIDL_FEATURE_DISABLE_AP"],
51        },
52        hidl_feature_disable_ap_mac_randomization: {
53            cppflags: ["-DWIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION"],
54        },
55        avoid_iface_reset_mac_change: {
56            cppflags: ["-DWIFI_AVOID_IFACE_RESET_MAC_CHANGE"],
57        },
58        wifi_skip_state_toggle_off_on_for_nan: {
59            cppflags: ["-DWIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN"],
60        },
61        hal_interface_combinations: {
62            cppflags: ["-DWIFI_HAL_INTERFACE_COMBINATIONS=%s"],
63        },
64    },
65}
66
67cc_library_static {
68    name: "android.hardware.wifi-service-lib",
69    defaults: ["android.hardware.wifi-service-cppflags-defaults"],
70    proprietary: true,
71    compile_multilib: "first",
72    cppflags: [
73        "-Wall",
74        "-Werror",
75        "-Wextra",
76    ],
77    // Allow implicit fallthroughs in wifi_legacy_hal.cpp until they are fixed.
78    cflags: ["-Wno-error=implicit-fallthrough"],
79    srcs: [
80        "aidl_struct_util.cpp",
81        "aidl_sync_util.cpp",
82        "ringbuffer.cpp",
83        "wifi.cpp",
84        "wifi_ap_iface.cpp",
85        "wifi_chip.cpp",
86        "wifi_feature_flags.cpp",
87        "wifi_iface_util.cpp",
88        "wifi_legacy_hal.cpp",
89        "wifi_legacy_hal_factory.cpp",
90        "wifi_legacy_hal_stubs.cpp",
91        "wifi_mode_controller.cpp",
92        "wifi_nan_iface.cpp",
93        "wifi_p2p_iface.cpp",
94        "wifi_rtt_controller.cpp",
95        "wifi_sta_iface.cpp",
96        "wifi_status_util.cpp",
97    ],
98
99    shared_libs: [
100        "libbase",
101        "libbinder_ndk",
102        "libcutils",
103        "liblog",
104        "libnl",
105        "libutils",
106        "libwifi-hal",
107        "libwifi-system-iface",
108        "libxml2",
109        "android.hardware.wifi-V2-ndk",
110    ],
111
112    export_include_dirs: ["."],
113}
114
115cc_binary {
116    name: "android.hardware.wifi-service",
117    vintf_fragments: ["android.hardware.wifi-service.xml"],
118    relative_install_path: "hw",
119    proprietary: true,
120    cppflags: [
121        "-Wall",
122        "-Werror",
123        "-Wextra",
124    ],
125    srcs: ["service.cpp"],
126    shared_libs: [
127        "libbase",
128        "libbinder_ndk",
129        "libcutils",
130        "liblog",
131        "libnl",
132        "libutils",
133        "libwifi-hal",
134        "libwifi-system-iface",
135        "libxml2",
136        "android.hardware.wifi-V2-ndk",
137    ],
138    static_libs: ["android.hardware.wifi-service-lib"],
139    init_rc: ["android.hardware.wifi-service.rc"],
140}
141
142cc_binary {
143    name: "android.hardware.wifi-service-lazy",
144    vintf_fragments: ["android.hardware.wifi-service.xml"],
145    overrides: ["android.hardware.wifi-service"],
146    cflags: ["-DLAZY_SERVICE"],
147    relative_install_path: "hw",
148    proprietary: true,
149    cppflags: [
150        "-Wall",
151        "-Werror",
152        "-Wextra",
153    ],
154    srcs: ["service.cpp"],
155    shared_libs: [
156        "libbase",
157        "libbinder_ndk",
158        "libcutils",
159        "liblog",
160        "libnl",
161        "libutils",
162        "libwifi-hal",
163        "libwifi-system-iface",
164        "libxml2",
165        "android.hardware.wifi-V2-ndk",
166    ],
167    static_libs: ["android.hardware.wifi-service-lib"],
168    init_rc: ["android.hardware.wifi-service-lazy.rc"],
169}
170
171cc_test {
172    name: "android.hardware.wifi-service-tests",
173    proprietary: true,
174    compile_multilib: "first",
175    cppflags: [
176        "-Wall",
177        "-Werror",
178        "-Wextra",
179    ],
180    srcs: [
181        "tests/aidl_struct_util_unit_tests.cpp",
182        "tests/main.cpp",
183        "tests/mock_interface_tool.cpp",
184        "tests/mock_wifi_feature_flags.cpp",
185        "tests/mock_wifi_iface_util.cpp",
186        "tests/mock_wifi_legacy_hal.cpp",
187        "tests/mock_wifi_mode_controller.cpp",
188        "tests/ringbuffer_unit_tests.cpp",
189        "tests/wifi_nan_iface_unit_tests.cpp",
190        "tests/wifi_chip_unit_tests.cpp",
191        "tests/wifi_iface_util_unit_tests.cpp",
192    ],
193    static_libs: [
194        "libgmock",
195        "libgtest",
196        "android.hardware.wifi-V2-ndk",
197        "android.hardware.wifi.common-V1-ndk",
198        "android.hardware.wifi-service-lib",
199    ],
200    shared_libs: [
201        "libbase",
202        "libbinder_ndk",
203        "libcutils",
204        "liblog",
205        "libnl",
206        "libutils",
207        "libwifi-hal",
208        "libwifi-system-iface",
209    ],
210}
211
212filegroup {
213    name: "default-android.hardware.wifi-service.rc",
214    srcs: ["android.hardware.wifi-service.rc"],
215}
216
217filegroup {
218    name: "default-android.hardware.wifi-service.xml",
219    srcs: ["android.hardware.wifi-service.xml"],
220}
221