diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-15 14:24:30 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-15 14:24:30 +0000 |
commit | 0b14afb65382ec550d64e08606d8c3d1ed7aa716 (patch) | |
tree | c8dfd5d62e2ed0283465fb265455bb7a59b38cc7 /chromeos | |
parent | f85c58431f5b549d9156e78515b5d6a6b13cc4c1 (diff) | |
download | chromium_src-0b14afb65382ec550d64e08606d8c3d1ed7aa716.zip chromium_src-0b14afb65382ec550d64e08606d8c3d1ed7aa716.tar.gz chromium_src-0b14afb65382ec550d64e08606d8c3d1ed7aa716.tar.bz2 |
chromeos: Don't override suspend-on-lid-closed.
This prevents PowerStateOverride::BLOCK_SYSTEM_SUSPEND,
which is used while the system is uploading or downloading
files or playing web audio, from setting the power manager's
disable_lid_suspend override. This override used to be
unimplemented in powerd, but it works now, and we don't want
the system to stay awake after the lid is closed.
It also renames PowerManagerClient::DISABLE_IDLE_LID_SUSPEND
to DISABLE_LID_SUSPEND; it doesn't have anything to do with
idleness.
BUG=176078
Review URL: https://chromiumcodereview.appspot.com/12260029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/dbus/power_manager_client.cc | 2 | ||||
-rw-r--r-- | chromeos/dbus/power_manager_client.h | 2 | ||||
-rw-r--r-- | chromeos/power/power_state_override.cc | 3 | ||||
-rw-r--r-- | chromeos/power/power_state_override.h | 3 | ||||
-rw-r--r-- | chromeos/power/power_state_override_unittest.cc | 6 |
5 files changed, 6 insertions, 10 deletions
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc index 54b46ae..a00296a 100644 --- a/chromeos/dbus/power_manager_client.cc +++ b/chromeos/dbus/power_manager_client.cc @@ -315,7 +315,7 @@ class PowerManagerClientImpl : public PowerManagerClient { protobuf.set_disable_idle_dim(overrides & DISABLE_IDLE_DIM); protobuf.set_disable_idle_blank(overrides & DISABLE_IDLE_BLANK); protobuf.set_disable_idle_suspend(overrides & DISABLE_IDLE_SUSPEND); - protobuf.set_disable_lid_suspend(overrides & DISABLE_IDLE_LID_SUSPEND); + protobuf.set_disable_lid_suspend(overrides & DISABLE_LID_SUSPEND); if (!writer.AppendProtoAsArrayOfBytes(protobuf)) { LOG(ERROR) << "Error calling " diff --git a/chromeos/dbus/power_manager_client.h b/chromeos/dbus/power_manager_client.h index 3accbadb..99ffd52 100644 --- a/chromeos/dbus/power_manager_client.h +++ b/chromeos/dbus/power_manager_client.h @@ -105,7 +105,7 @@ class CHROMEOS_EXPORT PowerManagerClient { DISABLE_IDLE_DIM = 1 << 0, // Disable screen dimming on idle. DISABLE_IDLE_BLANK = 1 << 1, // Disable screen blanking on idle. DISABLE_IDLE_SUSPEND = 1 << 2, // Disable suspend on idle. - DISABLE_IDLE_LID_SUSPEND = 1 << 3, // Disable suspend on lid closed. + DISABLE_LID_SUSPEND = 1 << 3, // Disable suspend on lid closed. }; // Adds and removes the observer. diff --git a/chromeos/power/power_state_override.cc b/chromeos/power/power_state_override.cc index ab9af01..b46e574 100644 --- a/chromeos/power/power_state_override.cc +++ b/chromeos/power/power_state_override.cc @@ -35,8 +35,7 @@ PowerStateOverride::PowerStateOverride(Mode mode) PowerManagerClient::DISABLE_IDLE_BLANK); // fallthrough case BLOCK_SYSTEM_SUSPEND: - override_types_ |= (PowerManagerClient::DISABLE_IDLE_SUSPEND | - PowerManagerClient::DISABLE_IDLE_LID_SUSPEND); + override_types_ |= PowerManagerClient::DISABLE_IDLE_SUSPEND; break; default: NOTREACHED() << "Unhandled mode " << mode; diff --git a/chromeos/power/power_state_override.h b/chromeos/power/power_state_override.h index b2e2572..08e31ee 100644 --- a/chromeos/power/power_state_override.h +++ b/chromeos/power/power_state_override.h @@ -26,8 +26,7 @@ class CHROMEOS_EXPORT PowerStateOverride // Also implies BLOCK_SYSTEM_SUSPEND. BLOCK_DISPLAY_SLEEP, - // Blocks the system from being suspended due to user inactivity or (in the - // case of a laptop) the lid being closed. + // Blocks the system from being suspended due to user inactivity. BLOCK_SYSTEM_SUSPEND, }; diff --git a/chromeos/power/power_state_override_unittest.cc b/chromeos/power/power_state_override_unittest.cc index 7b3c7da..b925980 100644 --- a/chromeos/power/power_state_override_unittest.cc +++ b/chromeos/power/power_state_override_unittest.cc @@ -57,11 +57,9 @@ TEST_F(PowerStateOverrideTest, AddAndRemoveOverrides) { const uint32 kDisplayOverrides = PowerManagerClient::DISABLE_IDLE_DIM | PowerManagerClient::DISABLE_IDLE_BLANK | - PowerManagerClient::DISABLE_IDLE_SUSPEND | - PowerManagerClient::DISABLE_IDLE_LID_SUSPEND; + PowerManagerClient::DISABLE_IDLE_SUSPEND; const uint32 kSystemOverrides = - PowerManagerClient::DISABLE_IDLE_SUSPEND | - PowerManagerClient::DISABLE_IDLE_LID_SUSPEND; + PowerManagerClient::DISABLE_IDLE_SUSPEND; // Block display sleep and pass a request ID to the callback. chromeos::PowerStateRequestIdCallback request_id_callback; |