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
This commit is contained in:
@ -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 "
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user