Filter out static library in PRODUCT_FACTORY_RAMDISK_MODULES

If there is shared library with the same name.

Change-Id: I6c18ffc2a6c1f6d5b6468677cc420be817ea950d
diff --git a/core/tasks/factory_ramdisk.mk b/core/tasks/factory_ramdisk.mk
index c4d792c..7b78657 100644
--- a/core/tasks/factory_ramdisk.mk
+++ b/core/tasks/factory_ramdisk.mk
@@ -25,8 +25,10 @@
 $(foreach m, $(factory_ramdisk_modules), \
     $(eval _fr_m_name := $(call word-colon,1,$(m))) \
     $(eval _fr_dest := $(call word-colon,2,$(m))) \
-    $(eval _fr_m_built := $(filter $(PRODUCT_OUT)/%, $(ALL_MODULES.$(_fr_m_name).BUILT))) \
+    $(eval _fr_m_built := $(filter-out %.a, $(filter $(PRODUCT_OUT)/%, $(ALL_MODULES.$(_fr_m_name).BUILT)))) \
     $(if $(_fr_m_built), \
+        $(if $(filter-out 1, $(words $(_fr_m_built))), \
+            $(error Error: module "$(m)" has multiple built files: "$(_fr_m_built)")) \
         $(eval _fulldest := $(TARGET_FACTORY_RAMDISK_OUT)/$(_fr_dest)) \
         $(eval $(call copy-one-file,$(_fr_m_built),$(_fulldest))) \
         $(eval INTERNAL_FACTORY_RAMDISK_EXTRA_MODULES_FILES += $(_fulldest)), \