bootable: Change how blank screen works

This is required on some devices where previous to 8.1/8.0 the blank
screen flag worked but don't now.

Test: Tested on begonia, screen is now no longer black

Change-Id: Ib4ff607d220bcb1aa5166fea23cc7ecb0e012fdd
diff --git a/gui/Android.mk b/gui/Android.mk
index 60ba325..02bd0a1 100755
--- a/gui/Android.mk
+++ b/gui/Android.mk
@@ -89,6 +89,9 @@
 ifeq ($(TW_ROUND_SCREEN), true)
     LOCAL_CFLAGS += -DTW_ROUND_SCREEN
 endif
+ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true)
+    LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT
+endif
 
 LOCAL_C_INCLUDES += \
     bionic \
diff --git a/gui/blanktimer.hpp b/gui/blanktimer.hpp
index fe7b77c..6aca270 100644
--- a/gui/blanktimer.hpp
+++ b/gui/blanktimer.hpp
@@ -42,10 +42,11 @@
 
 	bool isScreenOff();
 
+	void blank(void);
+
 private:
 	void setTimer(void);
 	string getBrightness(void);
-	void blank(void);
 
 	pthread_mutex_t mutex;
 	enum State { kOn = 0, kDim = 1, kOff = 2, kBlanked = 3 };
diff --git a/gui/gui.cpp b/gui/gui.cpp
index ce8c3e2..ade4d79 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -754,6 +754,12 @@
 	gr_init();
 	TWFunc::Set_Brightness(DataManager::GetStrValue("tw_brightness"));
 
+#ifdef TW_SCREEN_BLANK_ON_BOOT
+        printf("TW_SCREEN_BLANK_ON_BOOT := true\n");
+        blankTimer.blank();
+        blankTimer.resetTimerAndUnblank();
+#endif
+
 	// load and show splash screen
 	if (PageManager::LoadPackage("splash", TWRES "splash.xml", "splash")) {
 		LOGERR("Failed to load splash screen XML.\n");
diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk
index 2ca2091..7e5ddd8 100644
--- a/minuitwrp/Android.mk
+++ b/minuitwrp/Android.mk
@@ -142,9 +142,6 @@
 else
   LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
 endif
-ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true)
-    LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT
-endif
 ifeq ($(TW_FBIOPAN), true)
     LOCAL_CFLAGS += -DTW_FBIOPAN
 endif
diff --git a/minuitwrp/graphics.cpp b/minuitwrp/graphics.cpp
index 47ff3b9..c3d6ca5 100644
--- a/minuitwrp/graphics.cpp
+++ b/minuitwrp/graphics.cpp
@@ -421,12 +421,6 @@
     gr_flip();
     gr_flip();
 
-#ifdef TW_SCREEN_BLANK_ON_BOOT
-    printf("TW_SCREEN_BLANK_ON_BOOT := true\n");
-    gr_fb_blank(true);
-    gr_fb_blank(false);
-#endif
-
     return 0;
 }