Android.mk: error for missing TW_MAX_BRIGHTNESS
TW_MAX_BRIGHTNESS must be defined if using TW_NO_SCREEN_BLANK or TW_BRIGHTNESS_PATH.
Stop build with an error if flag is missing from device tree.
Change-Id: Idabc4f0f5d4e1b7efb1856fa113192edcd1b4ba6
diff --git a/Android.mk b/Android.mk
index a2088d7..4882688 100644
--- a/Android.mk
+++ b/Android.mk
@@ -372,6 +372,10 @@
endif
ifneq ($(TW_MAX_BRIGHTNESS),)
LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
+else
+ ifeq ($(filter $(TW_NO_SCREEN_BLANK) $(TW_BRIGHTNESS_PATH),),)
+ $(call pretty-error,TW_MAX_BRIGHTNESS must be defined if using TW_NO_SCREEN_BLANK or TW_BRIGHTNESS_PATH. Please update your device tree to include this flag with the correct value from your device.)
+ endif
endif
ifneq ($(TW_DEFAULT_BRIGHTNESS),)
LOCAL_CFLAGS += -DTW_DEFAULT_BRIGHTNESS=$(TW_DEFAULT_BRIGHTNESS)