hikey960: Add version check on the hisi vdec package
This adds a version check on the hisi vdec package and provides
a URL to the current expected package.
This did get a bit hacky as we can't check values set in the
vendor pkg makefile if we use inherit-product. So we have to
include it directly. I think we could do it better, but we would
have to re-spin the published vendor binary, so lets hack around
it this time and do better with the next package update.
Change-Id: Ic6832850e9b4d03b84358060810aa17e23e5b8ae
Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk
index d59b3f3..f96d77a 100644
--- a/hikey960/device-hikey960.mk
+++ b/hikey960/device-hikey960.mk
@@ -54,4 +54,18 @@
PRODUCT_PACKAGES += sensors.hikey960
-$(call inherit-product-if-exists, vendor/linaro/hikey960/device-vendor.mk)
+# Unfortunately inherit-product doesn't export build variables from the
+# called make file to the caller, so we have to include it directly here.
+# FIXME: Improve this the next time we update the binary package
+ifneq (,$(wildcard vendor/linaro/hikey960/hisilicon/device-partial.mk))
+include vendor/linaro/hikey960/hisilicon/device-partial.mk
+endif
+
+EXPECTED_HISI_CODEC_VERSION := 1
+# Check and make sure the vendor package is the expected version
+ifneq ($(TARGET_HISI_CODEC_VERSION),$(EXPECTED_HISI_CODEC_VERSION))
+$(warning TARGET_HISI_CODEC_VERSION ($(TARGET_HISI_CODEC_VERSION)) does not match exiting the build ($(EXPECTED_HISI_CODEC_VERSION)).)
+$(warning Please download new binaries here:)
+$(warning https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz )
+$(warning And extract in the ANDROID_TOP_DIR)
+endif