Add Fairphone 2 blobs check and makefile

Since Fairphone 2 proprietary blobs have been moved and they will be provided
as separate package this commit add a check in the build process to verify the
presence of blobs before continuing.

Change for Android 9: Print the get_blobs.py command line to simplify
downloading of missing blobs.

Issue: FP2N-322
Issue: FP2P-455
Change-Id: I7f2a65793689128fcb301f6b2a263d988a331854
(cherry picked from commit 50d6ff967669e792faf726113ba6d40c73b85e1b)
diff --git a/device.mk b/device.mk
index 7821b0d..78f94ea 100644
--- a/device.mk
+++ b/device.mk
@@ -13,6 +13,27 @@
 # limitations under the License.
 #
 
+BLOBS_PATH = $(abspath device/fairphone/fp2-proprietary)
+GET_BLOBS_CMD = vendor/fairphone/tools/bin/get_blobs.py --device FP2 --build-id $(BUILD_ID) --blobs-dir $(BLOBS_PATH)
+
+# Check the presence of proprietary blobs
+ifeq ("$(wildcard $(BLOBS_PATH)/device-vendor.mk)","")
+define BLOBS_INSTRUCTION
+
+
+Cannot find FP2 binary blobs.
+
+Please run
+
+  python3 $(GET_BLOBS_CMD)
+
+and accept the terms of agreement.
+
+
+endef
+$(error $(BLOBS_INSTRUCTION))
+endif
+
 # Call the vendor setup
 $(call inherit-product-if-exists, vendor/fairphone/fp2-common/device-vendor.mk)
 
@@ -32,8 +53,6 @@
 $(call inherit-product, device/qcom/common/common.mk)
 
 
-BLOBS_PATH = device/fairphone/fp2-proprietary
-
 # Call the proprietary setup
 $(call inherit-product, $(BLOBS_PATH)/device-vendor.mk)