Chromium Code Reviews| Index: media/capture/content/android/screen_capture_machine_android.cc |
| diff --git a/media/capture/content/android/screen_capture_machine_android.cc b/media/capture/content/android/screen_capture_machine_android.cc |
| index 6adbcbacd1979e5c625b757d1fc703b654ec3243..c58267a85870a97bf1434b25b21df01b9579b71e 100644 |
| --- a/media/capture/content/android/screen_capture_machine_android.cc |
| +++ b/media/capture/content/android/screen_capture_machine_android.cc |
| @@ -196,7 +196,10 @@ void ScreenCaptureMachineAndroid::OnActivityResult(JNIEnv* env, |
| return; |
| } |
| - Java_ScreenCapture_startCapture(env, obj); |
| + if (Java_ScreenCapture_startCapture(env, obj)) |
| + oracle_proxy_->ReportStarted(); |
| + else |
| + oracle_proxy_->ReportError(FROM_HERE, "Failed to start Screen Capture"); |
| } |
| void ScreenCaptureMachineAndroid::OnOrientationChange(JNIEnv* env, |
| @@ -258,8 +261,11 @@ void ScreenCaptureMachineAndroid::Start( |
| } |
| ret = Java_ScreenCapture_startPrompt(AttachCurrentThread(), j_capture_); |
| - |
| - callback.Run(ret); |
| + // On Android, we must wait for user input to start capturing before we can |
|
chfremer
2017/02/16 01:00:50
The "On Android, " is not needed, because it is cl
braveyao
2017/02/17 20:37:21
Done.
|
| + // report back device started state. However, if the user-prompt failed to |
| + // show, report a failed start immediately. |
| + if (!ret) |
| + callback.Run(ret); |
| } |
| void ScreenCaptureMachineAndroid::Stop(const base::Closure& callback) { |