diff options
author | Dees_Troy <dees_troy@yahoo.com> | 2013-02-18 02:52:09 +0100 |
---|---|---|
committer | Dees_Troy <dees_troy@yahoo.com> | 2013-02-20 16:35:23 +0100 |
commit | 2f9117af3099ff40c7baef4d5f533b35acb08617 (patch) | |
tree | 589296ad5f8892f47e81e328b094eef5ba98181d /gui/blanktimer.cpp | |
parent | support devices without bootpartition (diff) | |
download | android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.tar android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.tar.gz android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.tar.bz2 android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.tar.lz android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.tar.xz android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.tar.zst android_bootable_recovery-2f9117af3099ff40c7baef4d5f533b35acb08617.zip |
Diffstat (limited to 'gui/blanktimer.cpp')
-rw-r--r-- | gui/blanktimer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp index f64bb5f45..d991d40b3 100644 --- a/gui/blanktimer.cpp +++ b/gui/blanktimer.cpp @@ -50,6 +50,10 @@ blanktimer::blanktimer(void) { orig_brightness = getBrightness(); } +void blanktimer::setTime(int newtime) { + sleepTimer = newtime; +} + int blanktimer::setTimerThread(void) { pthread_t thread; ThreadPtr blankptr = &blanktimer::setClockTimer; @@ -84,13 +88,15 @@ int blanktimer::setClockTimer(void) { usleep(1000); clock_gettime(CLOCK_MONOTONIC, &curTime); diff = TWFunc::timespec_diff(btimer, curTime); - if (diff.tv_sec > sleepTimer && conblank != 1) + if (sleepTimer && diff.tv_sec > sleepTimer && conblank != 1) { + orig_brightness = getBrightness(); setBlank(1); + PageManager::ChangeOverlay("lock"); + } if (conblank == 1 && blanked != 1) { blanked = 1; gr_fb_blank(conblank); setBrightness(0); - PageManager::ChangeOverlay("lock"); } } return -1; |