summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Android.mk3
-rw-r--r--data.cpp26
-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
-rw-r--r--variables.h2
20 files changed, 109 insertions, 8 deletions
diff --git a/Android.mk b/Android.mk
index a6a82ef26..9ef4e67bd 100644
--- a/Android.mk
+++ b/Android.mk
@@ -99,6 +99,9 @@ endif
LOCAL_C_INCLUDES += system/extras/ext4_utils
#TWRP Build Flags
+ifneq ($(TW_NO_SCREEN_TIMEOUT),)
+ LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
+endif
ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
endif
diff --git a/data.cpp b/data.cpp
index c028897e6..be76592aa 100644
--- a/data.cpp
+++ b/data.cpp
@@ -40,7 +40,9 @@
#include "data.hpp"
#include "partitions.hpp"
#include "twrp-functions.hpp"
+#ifndef TW_NO_SCREEN_TIMEOUT
#include "gui/blanktimer.hpp"
+#endif
#ifdef TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
#include "cutils/properties.h"
@@ -59,11 +61,13 @@ extern "C"
using namespace std;
-map<string, DataManager::TStrIntPair> DataManager::mValues;
-map<string, string> DataManager::mConstValues;
-string DataManager::mBackingFile;
-int DataManager::mInitialized = 0;
+map<string, DataManager::TStrIntPair> DataManager::mValues;
+map<string, string> DataManager::mConstValues;
+string DataManager::mBackingFile;
+int DataManager::mInitialized = 0;
+#ifndef TW_NO_SCREEN_TIMEOUT
extern blanktimer blankTimer;
+#endif
// Device ID functions
void DataManager::sanitize_device_id(char* device_id) {
@@ -264,8 +268,10 @@ int DataManager::LoadValues(const string filename)
}
else
mValues.insert(TNameValuePair(Name, TStrIntPair(Value, 1)));
+#ifndef TW_NO_SCREEN_TIMEOUT
if (Name == "tw_screen_timeout_secs")
blankTimer.setTime(atoi(Value.c_str()));
+#endif
}
error:
fclose(in);
@@ -445,9 +451,13 @@ int DataManager::SetValue(const string varName, string value, int persist /* = 0
if (pos->second.second != 0)
SaveValues();
+
+#ifndef TW_NO_SCREEN_TIMEOUT
if (varName == "tw_screen_timeout_secs") {
blankTimer.setTime(atoi(value.c_str()));
- } else if (varName == "tw_storage_path") {
+ } else
+#endif
+ if (varName == "tw_storage_path") {
SetBackupFolder();
}
gui_notifyVarChange(varName.c_str(), value.c_str());
@@ -911,7 +921,13 @@ void DataManager::SetDefaultValues()
mValues.insert(make_pair("tw_background_thread_running", make_pair("0", 0)));
mValues.insert(make_pair(TW_RESTORE_FILE_DATE, make_pair("0", 0)));
mValues.insert(make_pair("tw_military_time", make_pair("0", 1)));
+#ifdef TW_NO_SCREEN_TIMEOUT
+ mValues.insert(make_pair("tw_screen_timeout_secs", make_pair("0", 1)));
+ mValues.insert(make_pair("tw_no_screen_timeout", make_pair("1", 1)));
+#else
mValues.insert(make_pair("tw_screen_timeout_secs", make_pair("60", 1)));
+ mValues.insert(make_pair("tw_no_screen_timeout", make_pair("0", 1)));
+#endif
mValues.insert(make_pair("tw_gui_done", make_pair("0", 0)));
mValues.insert(make_pair("tw_encrypt_backup", make_pair("0", 0)));
#ifdef TW_BRIGHTNESS_PATH
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);
}
diff --git a/variables.h b/variables.h
index 4020b7599..b8a938035 100644
--- a/variables.h
+++ b/variables.h
@@ -17,7 +17,7 @@
#ifndef _VARIABLES_HEADER_
#define _VARIABLES_HEADER_
-#define TW_VERSION_STR "2.6.0.0"
+#define TW_VERSION_STR "2.6.0.4"
#define TW_USE_COMPRESSION_VAR "tw_use_compression"
#define TW_FILENAME "tw_filename"