diff options
author | Tao Bao <tbao@google.com> | 2018-08-17 05:34:28 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-08-17 05:34:28 +0200 |
commit | 6ebca741fb7f2346a9a55a49a40bb66e37d54bcf (patch) | |
tree | 631777a56e503682c09ab39da0b2b3f8bd145255 | |
parent | Merge "updater: Add SourceInfo::{ReadAll,DumpBuffer,Overlaps}." am: d460afe963 (diff) | |
parent | Merge "ui: Only set brightness when needed." (diff) | |
download | android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.tar android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.tar.gz android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.tar.bz2 android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.tar.lz android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.tar.xz android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.tar.zst android_bootable_recovery-6ebca741fb7f2346a9a55a49a40bb66e37d54bcf.zip |
-rw-r--r-- | ui.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -454,8 +454,7 @@ int RecoveryUI::WaitKey() { return static_cast<int>(KeyError::INTERRUPTED); } - // Time out after UI_WAIT_KEY_TIMEOUT_SEC, unless a USB cable is - // plugged in. + // Time out after UI_WAIT_KEY_TIMEOUT_SEC, unless a USB cable is plugged in. do { bool rc = key_queue_cond.wait_for(lk, std::chrono::seconds(UI_WAIT_KEY_TIMEOUT_SEC), [this] { return this->key_queue_len != 0 || key_interrupted_; @@ -466,13 +465,13 @@ int RecoveryUI::WaitKey() { } if (screensaver_state_ != ScreensaverState::DISABLED) { if (!rc) { - // Lower the brightness level: NORMAL -> DIMMED; DIMMED -> OFF. + // Must be after a timeout. Lower the brightness level: NORMAL -> DIMMED; DIMMED -> OFF. if (screensaver_state_ == ScreensaverState::NORMAL) { SetScreensaverState(ScreensaverState::DIMMED); } else if (screensaver_state_ == ScreensaverState::DIMMED) { SetScreensaverState(ScreensaverState::OFF); } - } else { + } else if (screensaver_state_ != ScreensaverState::NORMAL) { // Drop the first key if it's changing from OFF to NORMAL. if (screensaver_state_ == ScreensaverState::OFF) { if (key_queue_len > 0) { |