Merge changes I0d9133d6,I10355093 into twrp2.5

* changes:
  Do not render the GUI when the blanktimer turns off the display.
  Console Render Bug caused by touch drag event
diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp
index 700a9ad..0b1f008 100644
--- a/gui/blanktimer.cpp
+++ b/gui/blanktimer.cpp
@@ -48,6 +48,11 @@
 	setTime(0);
 	setConBlank(0);
 	orig_brightness = getBrightness();
+	screenoff = false;
+}
+
+bool blanktimer::IsScreenOff() {
+	return screenoff;
 }
 
 void blanktimer::setTime(int newtime) {
@@ -92,6 +97,7 @@
 		if (sleepTimer && diff.tv_sec > sleepTimer && conblank < 2) {
 			setConBlank(2);
 			setBrightness(0);
+			screenoff = true;
 			PageManager::ChangeOverlay("lock");
 		}
 #ifndef TW_NO_SCREEN_BLANK
@@ -146,6 +152,7 @@
 			// No break here, we want to keep going
 		case 2:
 			gui_forceRender();
+			screenoff = false;
 			// No break here, we want to keep going
 		case 1:
 			setBrightness(orig_brightness);
diff --git a/gui/blanktimer.hpp b/gui/blanktimer.hpp
index 2d83c4d..60d5b1b 100644
--- a/gui/blanktimer.hpp
+++ b/gui/blanktimer.hpp
@@ -30,6 +30,7 @@
 		int setTimerThread(void);
 		void resetTimerAndUnblank(void);
 		void setTime(int newtime);
+		bool IsScreenOff();
 
 	private:
 		void setConBlank(int blank);
@@ -47,6 +48,7 @@
 		timespec btimer;
 		unsigned long long sleepTimer;
 		int orig_brightness;
+		bool screenoff;
 };
 
 extern blanktimer blankTimer;
diff --git a/gui/console.cpp b/gui/console.cpp
index 8a7a85e..ee3b5e5 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -274,6 +274,7 @@
     {
         // They're still touching, so re-render
         Render();
+        mLastTouchY = -1;
         return 2;
     }
     return 0;
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 11fe9b0..86d4dff 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -41,8 +41,10 @@
 
 #include "rapidxml.hpp"
 #include "objects.hpp"
+#include "blanktimer.hpp"
 
 extern int gGuiRunning;
+extern blanktimer blankTimer;
 
 std::map<std::string, PageSet*> PageManager::mPageSets;
 PageSet* PageManager::mCurrentSet;
@@ -890,6 +892,9 @@
 
 int PageManager::Update(void)
 {
+    if(blankTimer.IsScreenOff())
+        return 0;
+
     return (mCurrentSet ? mCurrentSet->Update() : -1);
 }