Commit 73d177ae authored by Wei Lee's avatar Wei Lee Committed by Commit Bot

[CCA] Finishes the intent when shouldHandleResult=false on SWA

This CL fixes a bug that on SWA the intent with shouldHandleResult=false
does not finish right after the app startup.

Bug: b/172780736
Test: tast run [DUT] camera.CCAUIIntent.*
Change-Id: Ie3069660d6e71d505caf4a9922fa1967deafb405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526854
Commit-Queue: Wei Lee <wtlee@chromium.org>
Commit-Queue: Shik Chen <shik@chromium.org>
Auto-Submit: Wei Lee <wtlee@chromium.org>
Reviewed-by: default avatarShik Chen <shik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825746}
parent cd895a03
...@@ -250,12 +250,6 @@ class CCAWindow { ...@@ -250,12 +250,6 @@ class CCAWindow {
*/ */
notifyActivation() { notifyActivation() {
this.state_ = WindowState.ACTIVE; this.state_ = WindowState.ACTIVE;
// For intent only requiring open camera with specific mode without
// returning the capture result, called onIntentHandled() right
// after app successfully launched.
if (this.intent_ !== null && !this.intent_.shouldHandleResult) {
this.intent_.finish();
}
this.callbacks_.onActive(this); this.callbacks_.onActive(this);
} }
......
...@@ -218,6 +218,13 @@ export class App { ...@@ -218,6 +218,13 @@ export class App {
await browserProxy.fitWindow(); await browserProxy.fitWindow();
windowController.enable(); windowController.enable();
this.backgroundOps_.notifyActivation(); this.backgroundOps_.notifyActivation();
// For intent only requiring open camera with specific mode without
// returning the capture result, called onIntentHandled() right
// after app successfully launched.
const intent = this.backgroundOps_.getIntent();
if (intent !== null && !intent.shouldHandleResult) {
intent.finish();
}
})(); })();
const cameraResourceInitialized = new WaitableEvent(); const cameraResourceInitialized = new WaitableEvent();
......
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