Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: ash/system/chromeos/power/tablet_power_button_controller.cc

Issue 2544073002: Resuming from suspend should stop backlights forced off if they are (Closed)
Patch Set: add test coverage Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/chromeos/power/tablet_power_button_controller.cc
diff --git a/ash/system/chromeos/power/tablet_power_button_controller.cc b/ash/system/chromeos/power/tablet_power_button_controller.cc
index 06d9efae2292990d999ea471bae6c94bf3424912..9b8a2cb5823fdcac8b3dc0e4d9140efb5b452683 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller.cc
@@ -94,10 +94,14 @@ void TabletPowerButtonController::OnPowerButtonEvent(
// When the system resumes in response to the power button being pressed,
// Chrome receives powerd's SuspendDone signal and notification that the
// backlight has been turned back on before seeing the power button events
- // that woke the system. Ignore events just after resuming to ensure that we
- // don't turn the screen off in response to the events.
+ // that woke the system. If backlights are forced off, stop forcing off
Daniel Erat 2016/12/02 00:58:27 nit: i'd move this "If ..." part down just before
+ // because resuming system doesn't handle this, otherwise ignore events
+ // just after resuming to ensure that we don't turn the screen off in response
+ // to the events.
if (timestamp - last_resume_time_ <=
base::TimeDelta::FromMilliseconds(kIgnorePowerButtonAfterResumeMs)) {
+ if (down && backlights_forced_off_)
+ SetBacklightsForcedOff(false);
Qiang(Joe) Xu 2016/12/02 01:06:38 Hi, just want to mention here, the long pressed sh
Daniel Erat 2016/12/02 01:10:26 are you just saying power button down events that
return;
}

Powered by Google App Engine
This is Rietveld 408576698