New issue
Advanced search Search tips

Issue 718082 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Android screencapture: possible hangs in stopCapture()

Project Member Reported by braveyao@chromium.org, May 3 2017

Issue description

What steps will reproduce the problem?
(1) Start a screen capture in Chrome on Android
(2) During the OS permission dialog stage, click 'Cancel' to deny the request.
(3) Start a screen capture again

What is the expected result?
See the OS permission dialog again

What happens instead?
No OS permission dialog show-up.

 
Project Member

Comment 1 by bugdroid1@chromium.org, May 4 2017

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

commit 8c6cff65cbe641a213c46a086fd7efb939b0e355
Author: braveyao <braveyao@chromium.org>
Date: Thu May 04 03:08:39 2017

Android screencapture: fix possible hang in stopCapture()

When user denies screencapture by clicking 'Cancel' in OS permission dialog,
Chrome will stop the capture after receiving the OnError() report. At this
point, the |mMediaProjection| is not created yet and |mCaptureState| has moved
to |ATTACHED|. So the capture state won't be |STOPPED| which will keep
stopCapture() waiting at [1].

The fix is to change the capture state to |STOPPED| for such a scenario.

[1]: https://cs.chromium.org/chromium/src/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java?l=324

BUG= 718082 

Review-Url: https://codereview.chromium.org/2857743003
Cr-Commit-Position: refs/heads/master@{#469255}

[modify] https://crrev.com/8c6cff65cbe641a213c46a086fd7efb939b0e355/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java

Status: Fixed (was: Assigned)
Labels: MissingTests
Is there a way we can write tests that catch issues like this?
Not now. It needs user inputs to start screen capture on Android at present.
Not now as in that it will be possible in the future or? Does it make sense to track writing such in a separate bug? If so, please create one.
After Android merges this permission dialog into dynamic permissions as same as camera/mic, there will be no such problem at all. So no unittest for this case will be needed any more in the future.

BTW: When this does happen, maybe in years as it has been postponed from O to P release and possibly on, I'll add general unittests for screen capture. But I don't want to create a crbug without action in years...
Labels: -MissingTests
Bugs are cheap, filed bug 722247 for adding a unittest :)
Labels: M-60

Sign in to add a comment