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

Unified Diff: backlight_controller.cc

Issue 6733005: Backlight off should not transition to dim or off states (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/power_manager.git
Patch Set: Created 9 years, 9 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 | powerd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: backlight_controller.cc
diff --git a/backlight_controller.cc b/backlight_controller.cc
index fa1507440478601b134bb5e8bb389edb176f3a84..3740cf2b769f3f0f4d36f6824bdef2d7aad94e2b 100644
--- a/backlight_controller.cc
+++ b/backlight_controller.cc
@@ -128,12 +128,17 @@ void BacklightController::DecreaseBrightness() {
}
}
-
bool BacklightController::SetPowerState(PowerState state) {
if (state == state_ || !is_initialized_)
return false;
CHECK(state != BACKLIGHT_UNINITIALIZED);
+ // If backlight is turned off, do not transition to dim or off states.
+ // From ACTIVE_OFF state only transition to ACTIVE_ON and SUSPEND states.
+ if (state_ == BACKLIGHT_ACTIVE_OFF && (state == BACKLIGHT_IDLE_OFF ||
+ state == BACKLIGHT_DIM))
+ return false;
+
LOG(INFO) << PowerStateToString(state_) << " -> "
<< PowerStateToString(state);
ReadBrightness();
« no previous file with comments | « no previous file | powerd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698