summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-07-01 22:34:53 +0200
committerGerrit Code Review <gerrit@5.9.244.119>2013-07-01 22:34:53 +0200
commitc322a1bc501ae6c37db1231ac48071b616c95354 (patch)
tree26a029a04c28ff05a8e3b1d5a1f343f93a29119c /gui
parentMerge "verifier_test : fix the call to verify_file" into twrp2.5 (diff)
parentDo not render the GUI when the blanktimer turns off the display. (diff)
downloadandroid_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.tar
android_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.tar.gz
android_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.tar.bz2
android_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.tar.lz
android_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.tar.xz
android_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.tar.zst
android_bootable_recovery-c322a1bc501ae6c37db1231ac48071b616c95354.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/blanktimer.cpp7
-rw-r--r--gui/blanktimer.hpp2
-rw-r--r--gui/console.cpp1
-rw-r--r--gui/pages.cpp5
4 files changed, 15 insertions, 0 deletions
diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp
index 700a9ad27..0b1f0083c 100644
--- a/gui/blanktimer.cpp
+++ b/gui/blanktimer.cpp
@@ -48,6 +48,11 @@ blanktimer::blanktimer(void) {
setTime(0);
setConBlank(0);
orig_brightness = getBrightness();
+ screenoff = false;
+}
+
+bool blanktimer::IsScreenOff() {
+ return screenoff;
}
void blanktimer::setTime(int newtime) {
@@ -92,6 +97,7 @@ int blanktimer::setClockTimer(void) {
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 @@ void blanktimer::resetTimerAndUnblank(void) {
// 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 2d83c4dae..60d5b1b42 100644
--- a/gui/blanktimer.hpp
+++ b/gui/blanktimer.hpp
@@ -30,6 +30,7 @@ class blanktimer {
int setTimerThread(void);
void resetTimerAndUnblank(void);
void setTime(int newtime);
+ bool IsScreenOff();
private:
void setConBlank(int blank);
@@ -47,6 +48,7 @@ class blanktimer {
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 8a7a85ea3..ee3b5e580 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -274,6 +274,7 @@ int GUIConsole::Update(void)
{
// 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 11fe9b080..86d4dff9f 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -41,8 +41,10 @@ extern "C" {
#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::Render(void)
int PageManager::Update(void)
{
+ if(blankTimer.IsScreenOff())
+ return 0;
+
return (mCurrentSet ? mCurrentSet->Update() : -1);
}