Revert "hal: audio-test: Move omx tests mm-audio-internal"

This reverts commit 2ce1027d13f23e34d6528968e94d6af876dc009c.

Also Fix NULL stream pointer LLVM issue by performing
NULL check before dereference the pointer

Change-Id: Ia2a8b3492b5424993e6c651555054d899f2ca3f2
diff --git a/mm-audio/aenc-amrnb/qdsp6/Android.mk b/mm-audio/aenc-amrnb/qdsp6/Android.mk
index 2e7453c..62124e9 100644
--- a/mm-audio/aenc-amrnb/qdsp6/Android.mk
+++ b/mm-audio/aenc-amrnb/qdsp6/Android.mk
@@ -42,6 +42,29 @@
 
 include $(BUILD_SHARED_LIBRARY)
 
+# ---------------------------------------------------------------------------------
+#             Make the apps-test (mm-aenc-omxamr-test)
+# ---------------------------------------------------------------------------------
+
+include $(CLEAR_VARS)
+
+mm-amr-enc-test-inc    := $(LOCAL_PATH)/inc
+mm-amr-enc-test-inc    += $(LOCAL_PATH)/test
+
+mm-amr-enc-test-inc    += $(TARGET_OUT_HEADERS)/mm-core/omxcore
+mm-amr-enc-test-inc    += $(TARGET_OUT_HEADERS)/mm-audio/audio-alsa
+LOCAL_MODULE            := mm-aenc-omxamr-test
+LOCAL_MODULE_TAGS       := optional
+LOCAL_CFLAGS            := $(libOmxAmrEnc-def)
+LOCAL_C_INCLUDES        := $(mm-amr-enc-test-inc)
+LOCAL_PRELINK_MODULE    := false
+LOCAL_SHARED_LIBRARIES  := libmm-omxcore
+LOCAL_SHARED_LIBRARIES  += libOmxAmrEnc
+LOCAL_SHARED_LIBRARIES  += libaudioalsa
+LOCAL_SRC_FILES         := test/omx_amr_enc_test.c
+
+include $(BUILD_EXECUTABLE)
+
 endif
 
 # ---------------------------------------------------------------------------------