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

Unified Diff: powerd.cc

Issue 6821016: Fix broken idle suspend (Closed) Base URL: ssh://gitrw.chromium.org:9222/power_manager.git@master
Patch Set: Created 9 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: powerd.cc
diff --git a/powerd.cc b/powerd.cc
index a25dc095192164b47ee26dbac525b2b32d09f393..38e873c0bef470068f1db7ac1f06147eaa2ddd0d 100644
--- a/powerd.cc
+++ b/powerd.cc
@@ -334,16 +334,15 @@ void Daemon::OnIdleEvent(bool is_idle, int64 idle_time_ms) {
void Daemon::SetIdleState(int64 idle_time_ms) {
bool changed_brightness = false;
if (idle_time_ms >= suspend_ms_) {
+ LOG(INFO) << "state = kIdleSuspend";
// Note: currently this state doesn't do anything. But it can be possibly
// useful in future development. For example, if we want to implement fade
// from suspend, we would want to have this state to make sure the backlight
// is set to zero when suspended.
- if (backlight_controller_->SetPowerState(BACKLIGHT_SUSPENDED)) {
- idle_state_ = kIdleSuspend;
- LOG(INFO) << "state = kIdleSuspend";
- changed_brightness = true;
- Suspend();
- }
+ changed_brightness =
+ backlight_controller_->SetPowerState(BACKLIGHT_SUSPENDED);
+ idle_state_ = kIdleSuspend;
+ Suspend();
} else if (idle_time_ms >= off_ms_) {
if (backlight_controller_->SetPowerState(BACKLIGHT_IDLE_OFF)) {
idle_state_ = kIdleScreenOff;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698