New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 773853 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Tapping power button turns off screen immediately on samus

Project Member Reported by steve...@chromium.org, Oct 11 2017

Issue description

Chrome Version: 63.0.3237.0
CrOS Version: 99973.0.0

If I tap the power button (which is easy to do accidentally_ the screen goes black immediately and the device is locked.

Long pressing the power button fades the display then turns the device off insstead of entering the lock screen.

This seems like tablet behavior?

 

Comment 1 by derat@chromium.org, Oct 11 2017

Joe, any chance this could've been an accidental side effect of https://crrev.com/c/702919?

It looks like samus has an accelerometer. Using the presence of an accelerometer as a proxy for "is a convertible" seems pretty fragile. :-(

Comment 2 by derat@chromium.org, Oct 11 2017

Cc: -warx@chromium.org tbuck...@chromium.org
Labels: -Type-Bug ReleaseBlock-Dev M-63 Type-Bug-Regression
Owner: warx@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by warx@chromium.org, Oct 11 2017

Yes, my fault for this change:

https://cs.chromium.org/chromium/src/ash/wm/tablet_mode/tablet_mode_controller.cc?type=cs&q=CanEnterTabletMode&l=159

The code I removed also checks IsEnabled(), which checks tablet mode switch. For samus, i think it has accelerometer data but not tablet mode switch.

I think I should restore the code to cover samus case.

Comment 4 by warx@chromium.org, Oct 11 2017

Status: Started (was: Assigned)
btw, that cl was landed on 63.0.3235.0. Definitely it is the culprit.
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5004f01e55433edf3f1582d7d0f04c0804f2afad

commit 5004f01e55433edf3f1582d7d0f04c0804f2afad
Author: Qiang Xu <warx@chromium.org>
Date: Thu Oct 12 01:15:59 2017

cros: restore TabletPowerButtonController::ShouldHandlePowerButtonEvents

Changes:
In CL: https://chromium-review.googlesource.com/c/chromium/src/+/702919,
we remove ShouldHandlePowerButtonEvents to use having seen accelerometer
data to enable tablet power button behavior. That neglects the
kAshEnableTabletMode switch check. On Samus device, it has accelerometer
but doesn't have kAshEnableTabletMode switch set since it is not able to
covert to tablet mode.

Bug:  773853 
Test: added test coverage
Change-Id: Ie68c112116a338e0a1be04ab14203723e14364cd
Reviewed-on: https://chromium-review.googlesource.com/714026
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508196}
[modify] https://crrev.com/5004f01e55433edf3f1582d7d0f04c0804f2afad/ash/system/power/power_button_test_base.cc
[modify] https://crrev.com/5004f01e55433edf3f1582d7d0f04c0804f2afad/ash/system/power/power_button_test_base.h
[modify] https://crrev.com/5004f01e55433edf3f1582d7d0f04c0804f2afad/ash/system/power/tablet_power_button_controller.cc
[modify] https://crrev.com/5004f01e55433edf3f1582d7d0f04c0804f2afad/ash/system/power/tablet_power_button_controller.h
[modify] https://crrev.com/5004f01e55433edf3f1582d7d0f04c0804f2afad/ash/system/power/tablet_power_button_controller_unittest.cc
[modify] https://crrev.com/5004f01e55433edf3f1582d7d0f04c0804f2afad/ash/wm/power_button_controller.cc

Comment 6 by warx@chromium.org, Oct 12 2017

Status: Fixed (was: Started)

Comment 7 by warx@chromium.org, Oct 13 2017

I still feel ShouldHandlePowerButtonEvents should be removed. On Samus device, TabletPowerButtonController instance should not be constructed since no tablet mode exists.

TabletPowerButtonController should only be constructed when TabletModeController::CanEnterTabletMode() is true.

I would add kAshEnableTabletMode switch check in [1], which I think is a better solution. We have added test coverage in #5.

[1] https://cs.chromium.org/chromium/src/ash/system/power/power_button_controller.cc?q=power_button_controller&dr=C&l=235

Comment 8 by derat@chromium.org, Oct 14 2017

Not initializing TabletPowerButtonController when tablet mode isn't possible makes sense to me.
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/517fa8e7a69d22c2fee11a61294f693c169565da

commit 517fa8e7a69d22c2fee11a61294f693c169565da
Author: Qiang Xu <warx@chromium.org>
Date: Fri Oct 20 03:01:30 2017

cros: remove TabletPowerButtonController::ShouldHandlePowerButtonEvents

changes:
ShouldHandlePowerButtonEvents() is equivalent to
TabletModeController::CanEnterTabletMode(), which is equivalent to having
tablet mode switch and having seen accelerometer data. We could just not
initialize TabletPowerButtonController in the first place.

Bug:  773853 
Test: test coverage by NoTabletModePowerButtonControllerTest
Change-Id: I3d386cf3aaa4f8957fdfb9e5badce33dcef75c97
Reviewed-on: https://chromium-review.googlesource.com/723605
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510310}
[modify] https://crrev.com/517fa8e7a69d22c2fee11a61294f693c169565da/ash/system/power/power_button_controller.cc
[modify] https://crrev.com/517fa8e7a69d22c2fee11a61294f693c169565da/ash/system/power/power_button_controller.h
[modify] https://crrev.com/517fa8e7a69d22c2fee11a61294f693c169565da/ash/system/power/tablet_power_button_controller.cc
[modify] https://crrev.com/517fa8e7a69d22c2fee11a61294f693c169565da/ash/system/power/tablet_power_button_controller.h
[modify] https://crrev.com/517fa8e7a69d22c2fee11a61294f693c169565da/ash/system/power/tablet_power_button_controller_unittest.cc

Sign in to add a comment