Commit fa79b41d authored by Kuo Jen Wei's avatar Kuo Jen Wei Committed by Commit Bot

CCA: Fix camera intent view cancel timer no result bug

Add check to early return from taking process of camera intent view if
the underlying camera view ends the take process earlier(e.g. timer
canceled) and produce no take result.

Bug: b/171874692
Test: Manually
Change-Id: I7aa8c70680e6c59fa013a0ced4738a200388b30d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505321
Commit-Queue: Inker Kuo <inker@chromium.org>
Auto-Submit: Inker Kuo <inker@chromium.org>
Reviewed-by: default avatarWei Lee <wtlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822076}
parent 3b49b072
...@@ -144,6 +144,10 @@ export class CameraIntent extends Camera { ...@@ -144,6 +144,10 @@ export class CameraIntent extends Camera {
} }
return (async () => { return (async () => {
await take; await take;
if (this.photoResult_ === null && this.videoResultFile_ === null) {
// In case of take early finish without any result e.g. Timer canceled.
return;
}
state.set(state.State.SUSPEND, true); state.set(state.State.SUSPEND, true);
await this.start(); await this.start();
...@@ -153,7 +157,7 @@ export class CameraIntent extends Camera { ...@@ -153,7 +157,7 @@ export class CameraIntent extends Camera {
} else if (this.videoResultFile_ !== null) { } else if (this.videoResultFile_ !== null) {
return this.reviewResult_.openVideo(this.videoResultFile_); return this.reviewResult_.openVideo(this.videoResultFile_);
} else { } else {
assertNotReached('End take without intent result.'); assertNotReached('None of intent result.');
} }
})(); })();
const result = this.photoResult_ || this.videoResult_; const result = this.photoResult_ || this.videoResult_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment