Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Unified Diff: media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java

Issue 2857743003: Android screencapture: fix possible hang in stopCapture() (Closed)
Patch Set: address nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java
diff --git a/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java b/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java
index 4956571caab08f3d39c7e6b8c3f56f96791b3749..11a8a3558f643931462b636dc8955e6abcca52fc 100644
--- a/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java
+++ b/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java
@@ -319,14 +319,16 @@ public class ScreenCapture extends Fragment {
if (mMediaProjection != null && mCaptureState == CaptureState.STARTED) {
mMediaProjection.stop();
changeCaptureStateAndNotify(CaptureState.STOPPING);
- }
- while (mCaptureState != CaptureState.STOPPED) {
- try {
- mCaptureStateLock.wait();
- } catch (InterruptedException ex) {
- Log.e(TAG, "ScreenCaptureEvent: " + ex);
+ while (mCaptureState != CaptureState.STOPPED) {
+ try {
+ mCaptureStateLock.wait();
+ } catch (InterruptedException ex) {
+ Log.e(TAG, "ScreenCaptureEvent: " + ex);
+ }
}
+ } else {
+ changeCaptureStateAndNotify(CaptureState.STOPPED);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698