New issue
Advanced search Search tips

Issue 904409 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Trusted Web Activity launch multiple app in svgomg

Reported by julien.t...@monisnap.com, Nov 12

Issue description

Application Version (from "Chrome Settings > About Chrome"): 72 (dev android)
Android Build Number (from "Android Settings > About Phone/Tablet"): Android 8.0.0
Device: One plus 3

Steps to reproduce: 
1- Launch svgomg (example android app for Trusted web activity)
2- Quit the app (not killed, just in background)
3- Click on the svgomg icon to go back to the app

Observed behavior: After clicking on the app icon, a new app is launched beside the old one, as if it was a different app.

Expected behavior: After clicking on the icon, the app in background should come back to foreground.

Frequency: Always happened
<number of times you were able to reproduce> 

Additional comments: 

 
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Components: Mobile>WebView
Labels: WV-Triaged Needs-Feedback
@ julien.tanghe: Could you please provide link to app or attach sample apk to test this issur from our end. If possible please provide screencast along with it, this would help in further triaging of the issue.

Thanks!
Hello,

Please find attached the apk of the app and the screenshot showing the two same app running simultaneously.

Thanks in advance for you help !
svgomg-debug.apk
1.3 MB Download
Screenshot_20181113-103950.jpg
371 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Nov 13

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Target-70 Target-71 Target-72 M-72 FoundIn-71 FoundIn-70 FoundIn-72 Pri-2 Type-Bug
Status: Untriaged (was: Unconfirmed)
Tested the issue in Android and able to reproduce the issue. 

Steps Followed:
1. Installed attached apk
2. Opened it, hit home button to quit the app,
3. Again opened app and observed multiple apps in recent tabs

Chrome versions tested:
61.0.3162.0 , 72.0.3609.3 [latest canary] , 70.0.3538.80

OS:
Android 8.0.0

Android Devices:
Nexus 6p

Issue is seen from older, hence considering this as Non-Regression and marking as Untriaged for further inputs from dev team.

Please navigate to below link for log's  --
go/chrome-androidlogs/904409

Thanks!
Components: -Mobile>WebView UI>Browser>Mobile>CustomTabs
TWA is not WebView, adding the correct components.
Owner: peconn@chromium.org
@ julien.tanghe: Somewhat coincidentally I think I fixed this bug yesterday (so after you'd reported it but before I heard about it)! The fix has landed: https://chromium-review.googlesource.com/c/custom-tabs-client/+/1335796 .

How are you building svgomg? If you don't mind messing around with the code locally, you could just copy the code change from LauncherActivity that I linked. 

Otherwise it may take a bit of time for the fix to make it into the custom-tabs-client github.
Hello,
It seems to work when i have chrome dev or canary installed so you fixed the problem.
However, i there might be a little regression. If i want to open it as a custom tabs (not a Trusted web activity) on devices that have chrome stable the app crash (i just modified the Chrome package from "com.google.android.apps.chrome" to "com.android.chrome" in the LauncherActivity so my chrome could open).
I tried to adapt the code by mixing it with the code from TwaSessionHelper (https://github.com/GoogleChrome/custom-tabs-client/blob/master/svgomg/src/main/java/org/chromium/twa/svgomg/TwaSessionHelper.java) but the function "getSession" seems to not returning anything, even in the callback function.

Could you tell me if it's a real issue or just my implementation that is bad ?

Thanks you very much for the support !
This is the error i get :

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.support.customtabs.CustomTabsSession.validateRelationship(int, android.net.Uri, android.os.Bundle)' on a null object reference
        at com.monisnap.monisnap.TwaSessionHelper.onServiceConnected(TwaSessionHelper.java:194)
        at org.chromium.customtabsclient.shared.ServiceConnection.onCustomTabsServiceConnected(ServiceConnection.java:38)
        at android.support.customtabs.CustomTabsServiceConnection.onServiceConnected(CustomTabsServiceConnection.java:44)
        at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1685)
        at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1714)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6798)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Status: Assigned (was: Untriaged)
As per comment#7 owner is already available, hence changing the status to Assigned. Please feel free to change if this is not the case.

Thanks!
Hello,

The problem is still unresolved. I think there was a regression because when i use the code of the public github, the classic custom tab launch if the user don't have chrome dev/canary installed.
Please find attached some additional information :
- Change i've made to launch chrome classic custom tab
- Error i get

Thanks in advance for you help !
Capture d’écran 2018-11-21 à 11.46.32.png
84.7 KB View Download
Capture d’écran 2018-11-21 à 11.47.46.png
281 KB View Download
Hello again,

I actually solved my problem using the old CustomTabsClient.java file (found in the custom tabs public repository : https://github.com/GoogleChrome/custom-tabs-client ) and modify it to remove unused/deprecated code and adding null parameter to "return new CustomTabsSession(mService, wrapper, mServiceComponentName, null);" at the end of the file. The modified file is attached to this message.

I will do more test to see if everything is ok but so far it seems to work very well.
CustomTabsClient.java
8.6 KB View Download

Sign in to add a comment