Add guard for AOSP hardware/qcom dir
Change-Id: Idb18776a546deabf248254074491052d211e5304
diff --git a/os_pickup_aosp.mk b/os_pickup_aosp.mk
new file mode 100644
index 0000000..0594556
--- /dev/null
+++ b/os_pickup_aosp.mk
@@ -0,0 +1,14 @@
+# This file guards most of hardware/qcom/* from
+# being used on devices which use hardware/qcom-caf/*
+
+# CAF devices still want AOSP bootctrl and keymaster HALs.
+CAF_DIRS := bootctrl keymaster
+LOCAL_PATH := $(call my-dir)
+
+ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
+# convert CAF_DIRS to something we can give to filter
+filter_CAF_DIRS := $(foreach dir,$(CAF_DIRS),%/$(dir)/Android.mk)
+include $(filter,$(filter_CAF_DIRS),$(call first-makefiles-under,$(LOCAL_PATH)))
+else
+include $(call first-makefiles-under,$(LOCAL_PATH))
+endif