audio: sndmonitor

Monitor sound card status and report online/offline
events back to the streams registered with it and to audio_dev.

Bug: 30075678
CRs-Fixed: 1053073
Change-Id: Iea74d5c83f7fe92ba4a24f4f4650ce255bdb48e8
diff --git a/hal/Android.mk b/hal/Android.mk
index 7f42432..705e5e8 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -315,6 +315,11 @@
 LOCAL_COPY_HEADERS_TO   := mm-audio
 LOCAL_COPY_HEADERS      := audio_extn/audio_defs.h
 
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SND_MONITOR)), true)
+    LOCAL_CFLAGS += -DSND_MONITOR_ENABLED
+    LOCAL_SRC_FILES += audio_extn/sndmonitor.c
+endif
+
 LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
 
 LOCAL_MODULE_RELATIVE_PATH := hw