Create a hostapd build target without the HIDL

Create a build target that does not incldue the HIDL control interface.
This is useful for emulators that use hostapd as a way to provide a
virtual access point while still allowing them to have a hostapd binary
with the HIDL control interface that can be used to support WiFi
hotspots.

Note: this cl does not impact real devices, as the target
device 'generic_x86, generic_x86_64, generic_arm and generic_arm64'
refer to emulator devices.
in addition, this will only impact emulator's vendor image

BUG: 74401469
Test: run cts -m CtsNetTestCases
Change-Id: I76a6ba18808bb2e2bb8a7f8978acdae71de6c325
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 54d12f6..c802165 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -1072,7 +1072,7 @@
 OBJS_c += src/utils/edit_simple.c
 endif
 
-ifeq ($(filter gce_x86 gce_x86_64 calypso generic_x86 generic_x86_64 generic generic_arm64, $(TARGET_DEVICE)),)
+ifeq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),)
 ifdef CONFIG_CTRL_IFACE_HIDL
 HOSTAPD_USE_HIDL=y
 L_CFLAGS += -DCONFIG_CTRL_IFACE_HIDL
@@ -1123,6 +1123,30 @@
 LOCAL_INIT_RC := hostapd.android.rc
 include $(BUILD_EXECUTABLE)
 
+########################
+include $(CLEAR_VARS)
+LOCAL_MODULE := hostapd_nohidl
+LOCAL_MODULE_TAGS := optional
+LOCAL_PROPRIETARY_MODULE := true
+ifdef CONFIG_DRIVER_CUSTOM
+LOCAL_STATIC_LIBRARIES := libCustomWifi
+endif
+ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
+LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
+endif
+LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
+ifdef CONFIG_DRIVER_NL80211
+ifneq ($(wildcard external/libnl),)
+LOCAL_SHARED_LIBRARIES += libnl
+else
+LOCAL_STATIC_LIBRARIES += libnl_2
+endif
+endif
+LOCAL_CFLAGS := $(patsubst -DCONFIG_CTRL_IFACE_HIDL,,$(L_CFLAGS))
+LOCAL_SRC_FILES := $(OBJS)
+LOCAL_C_INCLUDES := $(INCLUDES)
+include $(BUILD_EXECUTABLE)
+
 ifeq ($(HOSTAPD_USE_HIDL), y)
 ### Hidl service library ###
 ########################