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

Issue 712072 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 775131


Participants' hotlists:
Fixing-touch


Sign in to add a comment

Eng tracking: Android-like screenshot hotkey on Chrome OS tablet mode

Project Member Reported by satorux@google.com, Apr 17 2017

Issue description

Chrome Version       : 58.0.3029.68
OS Version: 9334.43.0


What steps will reproduce the problem?
1. Switch to the touchview mode
2. Press Power + Volume down, to take screenshot

What is the expected result?

Screenshot is taken

What happens instead of that?

The device is turned off

Please provide any additional information below. Attach a screenshot if
possible.

This happens if the user presses the Power button first and keeps pressing it with Volumen down button. 

See comment #10-13 in  issue 677772  for the background.
 

Comment 1 by derat@chromium.org, Apr 17 2017

Cc: tbuck...@chromium.org derat@chromium.org warx@chromium.org
I suspect that we should match Android's behavior here, right?

On a Nexus 5X running N, neither holding Power first and pressing Volume Down nor holding Volume Down and pressing Power takes a screenshot. Instead, I need to press both buttons roughly simultaneously and hold them for about half a second; then the screenshot is taken.

I don't have a convertible Chromebook handy right now, so I can't see how we compare.

Comment 2 by flackr@chromium.org, Apr 17 2017

On ChromeOS we require the volume down to be held first currently (I pointed to the original CL and code on  issue 677772 ). To match Android like behavior, I think we'll need to introduce some delays to the button handling, the button presses should wait some short amount of time to see if you press the other button or just the one.
I would love it if we could be a bit more forgiving for users not pressing both buttons exactly at the same time.

so if by mistake I clicked the power button slightly earlier than volume but I press both, I should still get a screenshot out of it and not have the screen turned off. 

Thoughts?

Comment 4 by warx@chromium.org, May 8 2017

On Chrome OS touchview, the step to take screenshot is first pressing volume down and then pressing power button (it is not designed to do reversely or simultaneously). If we follow this step, screen shall not be turned off.

About the plan to hold both simultaneously to match Android's behavior, I think for big screen, it is a little bit hard to operate that.
I understand that today the model is first volume down and then power. I just don't want to re-invent the wheel. If users are used to both buttons being pressed at the same time on Android (power/volume-) and iOS (power/home), we should make it more natural for them.

In other words, I'm thinking it should trigger a screenshot if user presses both buttons within ~700ms* of eachother (and both are in a pressed state simultaneously)

Yes, this means a side effect of not turning off the display for a long press within the first 700ms, but I think we can live with that. It might actually make it better for users as suddenly the volume bar will stop appearing in every video if users click power slightly earlier.

* Taking 700ms as it's our trigger for other double tap interactions but I didn't actually try it on users so could easily be convinced of a different magic number. Ideally we can try a few different ones and see how it works on users.


I agree we should be able to hit the buttons in either order. A couple thoughts:
1) Could we check with Android to see what their timeout is?
2) Could we add a flag that lets us switch between a few values, and then see the false positive rate for each?
Labels: M-61
Hi there flackr, any update?

Comment 8 by flackr@chromium.org, Jun 21 2017

Owner: tdander...@chromium.org
Terry, do you know who could pick this up? I'm happy to provide reviews and/or suggestions. It looks like the code for handling this has moved to power_button_controller.cc now.
Cc: osh...@chromium.org x...@chromium.org zork@chromium.org
Owner: ----
Status: Available (was: Assigned)
Re #8, I'm not sure who would be the clear owner for this, but I have cc'ed some people who may know.
Cc: abodenha@chromium.org
Owner: warx@chromium.org
Status: Assigned (was: Available)
I believe warx@ worked on this. +abodenha@ in case someone else should work on it.
Project Member

Comment 11 by sheriffbot@chromium.org, Jul 19 2017

Labels: Hotlist-Google

Comment 12 by warx@chromium.org, Aug 30 2017

Status: Started (was: Assigned)
I will start working on this feature to match Android's behavior. On android, Time to volume and power must be pressed within this interval of each other is 150 ms: https://cs.corp.google.com/android/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java?type=cs&q=screenshot+volume+down+package:%5Eandroid$&l=764

Comment 13 by warx@chromium.org, Aug 30 2017

Labels: -M-61 M-63

Comment 14 by warx@chromium.org, Oct 16 2017

Blocking: 775131
Project Member

Comment 15 by bugdroid1@chromium.org, Oct 17 2017

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

commit 3101a17d52c9efcf6de5a06ab576eb3f5e36711f
Author: Qiang Xu <warx@chromium.org>
Date: Tue Oct 17 19:19:26 2017

cros: introduce tablet mode power button screenshot chord

1-pager: go/tablet-mode-screenshot-hotkey

changes:
- Creates PowerButtonScreenshotController for handling tablet mode
  power button screenshot accelerator. It is android-like accelerator now,
  which requires pressing power button and volume down simultaneously, the
  delay currently is set to 150 ms.
- Makes volume down wait 150 ms (do not propagate it), and if power button
  is pressed, taking a screenshot, and do not propagate any volume down
  events.
- For tablet power button, volume down or volume up key pressed
  cancels/invalidates the tablet power button behavior.
- For forced clamshell power button (eve), make power button wait 150 ms,
  if volume key pressed, do not start the pressed clamshell power button.
- Removes old power button screenshot logic code.
- Add test coverage for new power button screenshot code.

Follow-up work:
- UMA: Record the delay between power button pressed and volume-down pressed.

button, also added test coverage in
power_button_screenshot_controller_unittest.cc

Bug:  712072 
Test: device test for both tablet power button and forced clamshell power
Change-Id: I31e0a49317079557904a9e435f210a532364acc9
Reviewed-on: https://chromium-review.googlesource.com/704193
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509479}
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/BUILD.gn
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_controller.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_controller.h
[add] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_screenshot_controller.cc
[add] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_screenshot_controller.h
[add] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_screenshot_controller_test_api.cc
[add] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_screenshot_controller_test_api.h
[add] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_screenshot_controller_unittest.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_test_base.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/power_button_test_base.h
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/tablet_power_button_controller.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/power/tablet_power_button_controller.h
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/tray/system_tray.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/tray/system_tray.h
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/tray/system_tray_item.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/system/tray/system_tray_item.h
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/test_screenshot_delegate.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/test_screenshot_delegate.h
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/ash/wm/lock_state_controller_unittest.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/chromeos/audio/cras_audio_handler.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/chromeos/audio/cras_audio_handler.h
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/chromeos/audio/cras_audio_handler_unittest.cc
[modify] https://crrev.com/3101a17d52c9efcf6de5a06ab576eb3f5e36711f/testing/buildbot/filters/ash_unittests_mash.filter

Comment 16 by warx@chromium.org, Oct 18 2017

Omri, Tom: I don't see power button + volume down key accelerator for taking screenshot  on tablet mode is on Help page. I think we shall add this in it. Who do you think could help this? tks 
I can reach out to caseymo@ about adding it to the Help Center.
Project Member

Comment 18 by bugdroid1@chromium.org, Oct 19 2017

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

commit e080e9d33f4c740aaa8bdbd66ae03d0e0a1b3104
Author: Qiang Xu <warx@chromium.org>
Date: Thu Oct 19 02:35:18 2017

cros: add UMAs for power button screenshot accel

1-pager: go/tablet-mode-screenshot-hotkey

changes:
- add UMA recording user action of taking screenshot by power button
  screenshot accel.
- add UMA recording the delay between power button pressed and volume
  down key pressed, which will help us determine the best delay time
  for users.

Bug:  712072 
Test: device test with chrome://histograms and chrome://user-actions
Change-Id: Ibce1c238ada747ca0400dbad3429b1e74722390c
Reviewed-on: https://chromium-review.googlesource.com/725220
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509979}
[modify] https://crrev.com/e080e9d33f4c740aaa8bdbd66ae03d0e0a1b3104/ash/system/power/power_button_screenshot_controller.cc
[modify] https://crrev.com/e080e9d33f4c740aaa8bdbd66ae03d0e0a1b3104/tools/metrics/actions/actions.xml
[modify] https://crrev.com/e080e9d33f4c740aaa8bdbd66ae03d0e0a1b3104/tools/metrics/histograms/histograms.xml

Comment 19 by warx@chromium.org, Oct 19 2017

Labels: -M-63 M-64
Status: Fixed (was: Started)
Landed on m-64. Dev work is done.

Comment 20 by warx@chromium.org, Oct 19 2017

Summary: Eng tracking: Android-like screenshot hotkey on Chrome OS tablet mode (was: Make screenshot hotkey in Touchview mode more reliable)
Great catch warx@
Thanks Tom, note that caseymo@ no longer works on ChromeOS, instead reach out to lauerm@
Status: Assigned (was: Fixed)
There's a CrOS audio regression. Please help revert this today because lots of audio autotests are broken by this. See http://crbug.com/777463 for details.

"cros: introduce tablet mode power button screenshot chord"
Project Member

Comment 23 by bugdroid1@chromium.org, Oct 28 2017

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

commit ba5e84707e445f119c232e3a41d6a51f0b45d2f5
Author: Qiang Xu <warx@chromium.org>
Date: Sat Oct 28 07:17:58 2017

cros: restore AutomatedVolumeChangeReason in CrasAudioHandler

changes:
The old logic in https://codereview.chromium.org/2250963003 seems
causing problem now, described in crbug.com/777463. We need to
reconsider the solution for  crbug.com/625222 .

TBR=xiyuan@chromium.org, jennyz@chromium.org

Bug: 777463,  712072 
Test: test that crbug.com/777463 is fixed.
Change-Id: I7f4a83896febaf05c74a83caf14afeb02b8758ac
Reviewed-on: https://chromium-review.googlesource.com/742390
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Reviewed-by: Qiang(Joe) Xu <warx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512389}
[modify] https://crrev.com/ba5e84707e445f119c232e3a41d6a51f0b45d2f5/chromeos/audio/cras_audio_handler.cc
[modify] https://crrev.com/ba5e84707e445f119c232e3a41d6a51f0b45d2f5/chromeos/audio/cras_audio_handler.h

Comment 24 by warx@chromium.org, Dec 6 2017

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)
Verified on 10279.0.0, 65.0.3311.0 eve

Sign in to add a comment