Screen on/off falls behind when repeatedly tapping tablet-style power button |
|||
Issue descriptionI'm not sure how easy this would be to fix, but on a ToT kevin build, if I tap the power button quickly, we seem to accumulate a backlog of commands to turn the display off and back on. I think that we mostly end up in the correct state (i.e. if I start out with the screen on and hit the button an even number of times, the screen eventually turns back on), but it'd be nice if we could stop sending requests when we're falling behind. Each button event results in the following, I think: a) powerd emits D-Bus signal b) Chrome makes D-Bus method call to powerd to start or stop forcing off c) powerd updates the backlight and makes method call to Chrome d) Chrome turns displays on or off I think that d), in particular, can take a while to complete. The display-configuration code is tricky and it's possible that there are races there. I tried to check what Android does in this case, but it launches the camera if you double-tap the power button. :-) I think things will get tricky if we start making Chrome's calls to powerd synchronous instead of fire-and-forget. Maybe a simple workaround would be to avoid forcing the display on or off for a power button release that we see within X ms of the previous power button release.
,
Jan 18 2017
Is this conflict with the new scheme "one second grace period for locking screen"? The grace period is added for the consideration that user may decide not to not turn display off in a short time so that user can turn it again without entering auth screen. But if we don't allow a most recent pressing for setting display on/off, this grace period that makes much sense.
,
Jan 20 2017
I'll just mention that the grace period is disabled at the moment. If we take a "ignore release within X ms of previous power button release" approach, I think that we want to make sure that it's only used when turning the screen off, and not when turning the screen on. That seems like it would prevent us from falling behind if the button is tapped over and over while still supporting the case where the user turns the screen off accidentally and immediately tries to turn it back on.
,
Jan 23 2017
"settings->display->Press power button twice for camera" can disable this feature. Then I test my nexus 6 by keep pressing/releasing power button quickly. It may stay on screen on (sometimes screen off), but finally screen on or off depending on even or odd pressing/releasing. However, I am not sure if android is dumping/ignoring unnecessary requests...
,
Jan 30 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e735c591f218ba5c5a315fb5973bacf3d41e25b8 commit e735c591f218ba5c5a315fb5973bacf3d41e25b8 Author: warx <warx@chromium.org> Date: Mon Jan 30 21:53:09 2017 ash: Drop the immediately following power button released induced forcing off request Changes: Record last power button released time and drop the immediately following (within 500ms) power button released induced forcing off request. BUG= 675291 TEST=device test: when screen is on, pressing/releasing side power button quickly, will see screen is off for only the first time. Behavior doesn't change for other cases. Also, test coverage TabletPowerButtonControllerTest.IgnoreRepeatedPowerButtonReleases is added. Review-Url: https://codereview.chromium.org/2664683002 Cr-Commit-Position: refs/heads/master@{#447081} [modify] https://crrev.com/e735c591f218ba5c5a315fb5973bacf3d41e25b8/ash/system/chromeos/power/tablet_power_button_controller.cc [modify] https://crrev.com/e735c591f218ba5c5a315fb5973bacf3d41e25b8/ash/system/chromeos/power/tablet_power_button_controller.h [modify] https://crrev.com/e735c591f218ba5c5a315fb5973bacf3d41e25b8/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
,
Jan 30 2017
,
Feb 24 2017
Verified on Cave: 58.0.3021.0/9313.0.0 (Official Build) dev |
|||
►
Sign in to add a comment |
|||
Comment 1 by warx@chromium.org
, Jan 10 2017Owner: warx@chromium.org
Status: Assigned (was: Available)