summaryrefslogtreecommitdiffstats
path: root/gui/blanktimer.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@yahoo.com>2013-03-24 14:54:55 +0100
committerDees_Troy <dees_troy@yahoo.com>2013-03-30 14:56:39 +0100
commita13d74fc95324c4318fcc95956b07fe593669412 (patch)
tree74654a9fae5e24e346842da733d68a70c5bfb716 /gui/blanktimer.cpp
parentAdd search function to libtar (diff)
downloadandroid_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.tar
android_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.tar.gz
android_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.tar.bz2
android_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.tar.lz
android_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.tar.xz
android_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.tar.zst
android_bootable_recovery-a13d74fc95324c4318fcc95956b07fe593669412.zip
Diffstat (limited to 'gui/blanktimer.cpp')
-rw-r--r--gui/blanktimer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp
index 7085557e8..17cc0b3d1 100644
--- a/gui/blanktimer.cpp
+++ b/gui/blanktimer.cpp
@@ -109,7 +109,17 @@ int blanktimer::getBrightness(void) {
string brightness_path = EXPAND(TW_BRIGHTNESS_PATH);
if ((TWFunc::read_file(brightness_path, results)) != 0)
return -1;
- return atoi(results.c_str());
+ int result = atoi(results.c_str());
+ if (result == 0) {
+ int tw_brightness;
+ DataManager::GetValue("tw_brightness", tw_brightness);
+ if (tw_brightness) {
+ result = tw_brightness;
+ } else {
+ result = 255;
+ }
+ }
+ return result;
}