recovery: allow usage of TARGET_CRYPTFS_HW_PATH

only if not defined fallback to the default
more flexible device config where the cryptfs_hw is located

Change-Id: I7d1c18eeae877e48dceff06a7cfead28c89797b4
diff --git a/crypto/lollipop/Android.mk b/crypto/lollipop/Android.mk
index 16dfd28..6dc386a 100644
--- a/crypto/lollipop/Android.mk
+++ b/crypto/lollipop/Android.mk
@@ -10,7 +10,11 @@
 LOCAL_C_INCLUDES := external/openssl/include $(commands_recovery_local_path)/crypto/scrypt/lib/crypto
 
 ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
-    LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw
+    ifeq ($(TARGET_CRYPTFS_HW_PATH),)
+        LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw
+    else
+        LOCAL_C_INCLUDES += $(TARGET_CRYPTFS_HW_PATH)
+    endif
     LOCAL_SHARED_LIBRARIES += libcryptfs_hw
     LOCAL_CFLAGS += -DCONFIG_HW_DISK_ENCRYPTION
 endif
@@ -36,7 +40,11 @@
 LOCAL_C_INCLUDES := external/openssl/include $(commands_recovery_local_path)/crypto/scrypt/lib/crypto
 
 ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
-    LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw
+    ifeq ($(TARGET_CRYPTFS_HW_PATH),)
+        LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw
+    else
+        LOCAL_C_INCLUDES += $(TARGET_CRYPTFS_HW_PATH)
+    endif
     LOCAL_SHARED_LIBRARIES += libcryptfs_hw
     LOCAL_CFLAGS += -DCONFIG_HW_DISK_ENCRYPTION
 endif