| 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..d5757e8e7e164edf06f00093cf1ef0ba4934fa94 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);
|
| + // Must wait for user input to start capturing before we can 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) {
|
|
|