New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 800316 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Trusted Web Activities not started with flags

Reported by markst3v...@gmail.com, Jan 9 2018

Issue description

Steps to reproduce the problem:
1.  Using Android support lib 27.0.2 setup a Chrome CustomTabsIntent with flags Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
2. Launch it as a Trusted Web Activity: TrustedWebUtils.launchAsTrustedWebActivity(activity, customTabsIntent, Uri.parse(url));

3. The flags are passed onto IntentDispatcher but not onto WebappActivity. This means the WebappActivity hangs around in the activity stack and recent apps view. Normal custom tabs don't do this as they get the flags passed onto them. 

What is the expected behavior?
Flags passed onto WebappActivity

What went wrong?
Flags were not passed onto WebappActivity

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 65.0.3315.0  Channel: canary
OS Version: 8.1.0
Flash Version: N/A

The above code results in the following logcat:
ActivityManager: START u0 {act=android.intent.action.VIEW dat=<redacted> flg=0x40800000 pkg=com.chrome.canary cmp=com.chrome.canary/com.google.android.apps.chrome.IntentDispatcher (edited)

ActivityManager: START u0 {act=android.intent.action.VIEW dat=<redacted> flg=0x14080000 cmp=com.chrome.canary/org.chromium.chrome.browser.webapps.WebappActivity (has extras)} from uid 10247

The IntentDispatcher is launched with the flags as in the above code (0x40800000) but the WebappActivity is launched with the flags 0x14080000:
FLAG_RECEIVER_FOREGROUND | FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
 
Labels: Needs-triage-Mobile
Cc: sandeepkumars@chromium.org
Components: UI>Browser>Mobile>CustomTabs
Labels: TE-NeedsTriageHelp Triaged-Mobile
Adding appropriate component and TE-NeedsTriageHelp as this issue seems to be out of TE scope.

Thanks!!

Comment 3 by peconn@chromium.org, Jun 19 2018

Owner: amalova@chromium.org
Status: Assigned (was: Unconfirmed)
This looks like a decent bug for amalova.
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4a8f9e5f475a5e09b13813d56372732aaa3cad4d

commit 4a8f9e5f475a5e09b13813d56372732aaa3cad4d
Author: Anna Malova <amalova@chromium.org>
Date: Tue Jun 26 19:57:27 2018

pass flags onto TWA from the intent

Bug:  800316 
Change-Id: Ibc4c89a8032f0ef343aee4477d96c92203de0a2a
Reviewed-on: https://chromium-review.googlesource.com/1113929
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Peter Conn <peconn@chromium.org>
Commit-Queue: Anna Malova <amalova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570503}
[modify] https://crrev.com/4a8f9e5f475a5e09b13813d56372732aaa3cad4d/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java

Status: Fixed (was: Assigned)

Sign in to add a comment