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

Unified Diff: chrome/browser/chromeos/power/light_bar.cc

Issue 589723003: Enable dark_resume_always workaround if the wake-on-packets flag is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move code to LightBar class Created 6 years, 3 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: chrome/browser/chromeos/power/light_bar.cc
diff --git a/chrome/browser/chromeos/power/light_bar.cc b/chrome/browser/chromeos/power/light_bar.cc
index fce9171dcb2b1c05886a0a62b0dd9009d961da35..8c2104957b538f6a6e7fd2de8fe280362fcecb64 100644
--- a/chrome/browser/chromeos/power/light_bar.cc
+++ b/chrome/browser/chromeos/power/light_bar.cc
@@ -21,12 +21,30 @@ const char kLightBarControlPath[] =
"/sys/devices/virtual/chromeos/cros_ec/lightbar/sequence";
const char kKonamiCommand[] = "KONAMI";
+// TODO(chirantan): These are used by a temporary workaround for lucid sleep and
+// should be removed once the proper implementation is ready (crbug.com/414949).
+const char kDarkResumeAlwaysFile[] = "/sys/power/dark_resume_always";
+const char kEnableDarkResumeAlways[] = "1";
+
} // namespace
LightBar::LightBar()
: control_path_(base::FilePath(kLightBarControlPath)),
has_light_bar_(base::PathIsWritable(control_path_)) {
DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
+
+ // Until the kernel can properly detect the wakeup source, we need to use a
+ // hack to tell the kernel to always enter dark resume. Chrome can then
+ // detect any user activity and have the power manager transition out of dark
+ // resume into regular resume. We don't care if the write succeeds or not
+ // because most devices will not have this file.
+ //
+ // TODO(chirantan): Remove this once we can properly detect the wakeup
+ // source (crbug.com/414949).
+ base::WriteFile(base::FilePath(kDarkResumeAlwaysFile),
+ kEnableDarkResumeAlways,
+ strlen(kEnableDarkResumeAlways));
+
Daniel Erat 2014/09/22 19:52:00 nit: delete extra blank line
}
LightBar::~LightBar() {
« 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