summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/Android.mk3
-rw-r--r--gui/action.cpp7
-rwxr-xr-xgui/devices/1024x600/res/ui.xml3
-rw-r--r--gui/devices/1024x768/res/ui.xml3
-rw-r--r--gui/devices/1080x1920/res/ui.xml3
-rw-r--r--gui/devices/1280x800/res/ui.xml3
-rw-r--r--gui/devices/1920x1200/res/ui.xml3
-rw-r--r--gui/devices/2560x1600/res/ui.xml3
-rw-r--r--gui/devices/320x480/res/ui.xml3
-rw-r--r--gui/devices/480x800/res/ui.xml3
-rw-r--r--gui/devices/480x854/res/ui.xml3
-rw-r--r--gui/devices/540x960/res/ui.xml3
-rw-r--r--gui/devices/720x1280/res/ui.xml3
-rwxr-xr-xgui/devices/800x1280/res/ui.xml3
-rwxr-xr-xgui/devices/800x480/res/ui.xml3
-rw-r--r--gui/gui.cpp30
-rw-r--r--gui/pages.cpp7
17 files changed, 84 insertions, 2 deletions
diff --git a/gui/Android.mk b/gui/Android.mk
index 7ac4bac9b..18decd047 100644
--- a/gui/Android.mk
+++ b/gui/Android.mk
@@ -61,6 +61,9 @@ endif
ifneq ($(TW_NO_SCREEN_BLANK),)
LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
endif
+ifneq ($(TW_NO_SCREEN_TIMEOUT),)
+ LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
+endif
LOCAL_C_INCLUDES += bionic external/stlport/stlport $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)
diff --git a/gui/action.cpp b/gui/action.cpp
index ee3373154..d67e697b0 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -40,8 +40,9 @@
#include "../openrecoveryscript.hpp"
#include "../adb_install.h"
+#ifndef TW_NO_SCREEN_TIMEOUT
#include "blanktimer.hpp"
-
+#endif
extern "C" {
#include "../twcommon.h"
#include "../minuitwrp/minui.h"
@@ -59,7 +60,9 @@ int gui_start();
#include "rapidxml.hpp"
#include "objects.hpp"
+#ifndef TW_NO_SCREEN_TIMEOUT
extern blanktimer blankTimer;
+#endif
void curtainClose(void);
@@ -339,7 +342,9 @@ void GUIAction::operation_end(const int operation_status, const int simulate)
}
DataManager::SetValue("tw_operation_state", 1);
DataManager::SetValue(TW_ACTION_BUSY, 0);
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index 5979c50b0..2b7d20e2e 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -2587,6 +2587,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2596,6 +2597,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2603,6 +2605,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="slidervalue_x" y="%row5_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index 86cfddab4..b625174a4 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -2587,6 +2587,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2596,6 +2597,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2603,6 +2605,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="slidervalue_x" y="%row5_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml
index e23086ac4..29c8bc303 100644
--- a/gui/devices/1080x1920/res/ui.xml
+++ b/gui/devices/1080x1920/res/ui.xml
@@ -2598,6 +2598,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2607,6 +2608,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2614,6 +2616,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index 4a066a3b1..b86f99171 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -2587,6 +2587,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2596,6 +2597,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2603,6 +2605,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="slidervalue_x" y="%row5_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index 458a72371..157005f1a 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -2587,6 +2587,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2596,6 +2597,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2603,6 +2605,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="slidervalue_x" y="%row5_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index 6a77a4fc1..3d6b65f5c 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -2587,6 +2587,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2596,6 +2597,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2603,6 +2605,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="slidervalue_x" y="%row5_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index 041a1356b..0719a942c 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -2585,6 +2585,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2594,6 +2595,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2601,6 +2603,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index 2b428b40e..b7b527bb9 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -2585,6 +2585,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2594,6 +2595,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2601,6 +2603,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index f8d6da167..cb6577f20 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -2584,6 +2584,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2593,6 +2594,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2600,6 +2602,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index 7448ddf6e..078f1ae51 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -2585,6 +2585,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2594,6 +2595,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2601,6 +2603,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index 2319c555b..d2896cc94 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -2598,6 +2598,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2607,6 +2608,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2614,6 +2616,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index 692c736c7..ba7dba321 100755
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -2586,6 +2586,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2595,6 +2596,7 @@
<placement x="%col1_x%" y="%row2_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2602,6 +2604,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="col1_x" y="%row4_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index 768f246f1..ba262bcce 100755
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -2595,6 +2595,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_false" />
<action function="set">tw_screen_timeout_secs=60</action>
@@ -2604,6 +2605,7 @@
<placement x="%slidervalue_x%" y="%row3_text_y%" />
<font resource="font" color="%text_color%" />
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<text>Enable screen timeout.</text>
<image resource="checkbox_true" />
<action function="set">tw_screen_timeout_secs=0</action>
@@ -2611,6 +2613,7 @@
<object type="slidervalue">
<condition var1="tw_screen_timeout_secs" op="!=" var2="0" />
+ <condition var1="tw_no_screen_timeout" op="!=" var2="1" />
<placement x="slidervalue_x" y="%row5_text_y%" w="%slidervalue_w%" />
<font resource="font" color="%text_color%" />
<colors line="%slidervalue_line_clr%" slider="%slidervalue_slider_clr%" />
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 821c7f5b2..6ee29d57b 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -47,7 +47,9 @@ extern "C"
#include "../variables.h"
#include "../partitions.hpp"
#include "../twrp-functions.hpp"
+#ifndef TW_NO_SCREEN_TIMEOUT
#include "blanktimer.hpp"
+#endif
const static int CURTAIN_FADE = 32;
@@ -62,7 +64,9 @@ static int gForceRender = 0;
pthread_mutex_t gForceRendermutex;
static int gNoAnimation = 1;
static int gGuiInputRunning = 0;
+#ifndef TW_NO_SCREEN_TIMEOUT
blanktimer blankTimer;
+#endif
// Needed by pages.cpp too
int gGuiRunning = 0;
@@ -167,6 +171,7 @@ void curtainClose()
static void * input_thread(void *cookie)
{
+
int drag = 0;
static int touch_and_hold = 0, dontwait = 0;
static int touch_repeat = 0, key_repeat = 0;
@@ -176,10 +181,14 @@ static void * input_thread(void *cookie)
HardwareKeyboard kb;
string seconds;
+#ifndef TW_NO_SCREEN_TIMEOUT
//start screen timeout threads
blankTimer.setTimerThread();
DataManager::GetValue("tw_screen_timeout_secs", seconds);
blankTimer.setTime(atoi(seconds.c_str()));
+#else
+ LOGINFO("Skipping screen timeout threads: TW_NO_SCREEN_TIMEOUT is set\n");
+#endif
for (;;)
{
@@ -208,7 +217,9 @@ static void * input_thread(void *cookie)
LOGERR("TOUCH_HOLD: %d,%d\n", x, y);
#endif
PageManager::NotifyTouch(TOUCH_HOLD, x, y);
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
else if (touch_repeat && mtime > 100)
{
@@ -217,7 +228,9 @@ static void * input_thread(void *cookie)
#endif
gettimeofday(&touchStart, NULL);
PageManager::NotifyTouch(TOUCH_REPEAT, x, y);
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
else if (key_repeat == 1 && mtime > 500)
{
@@ -227,7 +240,10 @@ static void * input_thread(void *cookie)
gettimeofday(&touchStart, NULL);
key_repeat = 2;
kb.KeyRepeat();
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
+
}
else if (key_repeat == 2 && mtime > 100)
{
@@ -236,7 +252,9 @@ static void * input_thread(void *cookie)
#endif
gettimeofday(&touchStart, NULL);
kb.KeyRepeat();
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
}
else if (ev.type == EV_ABS)
@@ -253,7 +271,9 @@ static void * input_thread(void *cookie)
LOGERR("TOUCH_RELEASE: %d,%d\n", x, y);
#endif
PageManager::NotifyTouch(TOUCH_RELEASE, x, y);
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
touch_and_hold = 0;
touch_repeat = 0;
if (!key_repeat)
@@ -276,7 +296,9 @@ static void * input_thread(void *cookie)
dontwait = 1;
key_repeat = 0;
gettimeofday(&touchStart, NULL);
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
else
{
@@ -288,7 +310,9 @@ static void * input_thread(void *cookie)
if (PageManager::NotifyTouch(TOUCH_DRAG, x, y) > 0)
state = 1;
key_repeat = 0;
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
}
}
@@ -309,7 +333,9 @@ static void * input_thread(void *cookie)
touch_repeat = 0;
dontwait = 1;
gettimeofday(&touchStart, NULL);
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
else
{
@@ -317,7 +343,9 @@ static void * input_thread(void *cookie)
touch_and_hold = 0;
touch_repeat = 0;
dontwait = 0;
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
}
else
@@ -328,7 +356,9 @@ static void * input_thread(void *cookie)
touch_and_hold = 0;
touch_repeat = 0;
dontwait = 0;
+#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
+#endif
}
}
}
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 9aea1b85a..2bb70e170 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -41,10 +41,14 @@ extern "C" {
#include "rapidxml.hpp"
#include "objects.hpp"
+#ifndef TW_NO_SCREEN_TIMEOUT
#include "blanktimer.hpp"
+#endif
extern int gGuiRunning;
+#ifndef TW_NO_SCREEN_TIMEOUT
extern blanktimer blankTimer;
+#endif
std::map<std::string, PageSet*> PageManager::mPageSets;
PageSet* PageManager::mCurrentSet;
@@ -919,9 +923,10 @@ int PageManager::Render(void)
int PageManager::Update(void)
{
+#ifndef TW_NO_SCREEN_TIMEOUT
if(blankTimer.IsScreenOff())
return 0;
-
+#endif
return (mCurrentSet ? mCurrentSet->Update() : -1);
}