summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorgordon1337 <gsysgordon@gmail.com>2013-06-08 14:17:07 +0200
committergordon1337 <gsysgordon@gmail.com>2013-06-08 14:17:07 +0200
commit0d9133d654805be31a7e21f4ccb74e9e0a44fd55 (patch)
tree0a1c0bae00b525fbbc1a3e50dad02d2e50330d47 /gui
parentConsole Render Bug caused by touch drag event (diff)
downloadandroid_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.tar
android_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.tar.gz
android_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.tar.bz2
android_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.tar.lz
android_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.tar.xz
android_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.tar.zst
android_bootable_recovery-0d9133d654805be31a7e21f4ccb74e9e0a44fd55.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/blanktimer.cpp7
-rw-r--r--gui/blanktimer.hpp2
-rw-r--r--gui/pages.cpp5
3 files changed, 14 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/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);
}