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..e9381fcba75b130b621895c05a7e76ccc08ccb98 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,10 @@ 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 |
| + // report back device started state. |
|
miu
2017/02/09 22:21:49
Maybe add: However, if the user-prompt failed to s
braveyao
2017/02/14 01:05:49
Done.
|
| + if (!ret) |
| + callback.Run(ret); |
| } |
| void ScreenCaptureMachineAndroid::Stop(const base::Closure& callback) { |