Fenix: FNX2-15165 ⁃ [Bug] Crash when custom tab is opened in browser

Created on 6 Jul 2020  ·  12Comments  ·  Source: mozilla-mobile/fenix

Steps to reproduce

-Set the new nightly (formerly Preview) as default browser
-Open a link from Gmail in a custom tab
-Open the toolbar menu and tap on "open in Firefox nightly"

Expected behavior

Custom tab opens in Nightly

Actual behavior

Browser crashes (although it does open in the browser in the background before it crashes - you'll see it in the tab list if opening the browser after the crash)

Device information

  • Android device: pixel 4
  • Fenix version: Nightly 200706 06:01 (Build #21880609)
CustomTabs crash engverified ac 🐞 bug

Most helpful comment

A patch just landed in AC for this. There will be a follow-up patch in Fenix needed and I am going to open a PR for that today. :)

All 12 comments

Dupe #12277

26b0f567-d616-4c5c-a768-57568c9215b9

java.lang.IllegalStateException: SET SESSION: Current activity: HomeActivity Other activity: ExternalAppBrowserActivity

java.lang.IllegalStateException: SET SESSION: Current activity: HomeActivity Other activity: ExternalAppBrowserActivity
at mozilla.components.browser.engine.gecko.GeckoEngineView.render(GeckoEngineView.kt:17)
at mozilla.components.feature.session.engine.EngineViewPresenter.access$onEngineSession(EngineViewPresenter.kt:2)
at mozilla.components.feature.session.engine.EngineViewPresenter$start$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:2)
at mozilla.components.support.ktx.kotlinx.coroutines.flow.FlowKt$ifChanged$$inlined$filter$1$2.emit(Collect.kt:7)
at mozilla.components.feature.session.engine.EngineViewPresenter$start$1$invokeSuspend$$inlined$map$2$2.emit(Collect.kt:3)
at mozilla.components.feature.session.engine.EngineViewPresenter$start$1$invokeSuspend$$inlined$map$1$2.emit(Collect.kt:3)
at kotlinx.coroutines.flow.FlowKt.emitAllImpl$FlowKt__ChannelsKt(Unknown Source:11)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Unknown Source:11)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:3)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:21)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:239)
at android.app.ActivityThread.main(ActivityThread.java:7500)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: java.lang.IllegalStateException: Display already acquired
at org.mozilla.geckoview.GeckoSession.acquireDisplay(GeckoSession.java:5)
at org.mozilla.geckoview.GeckoView.setSession(GeckoView.java:7)
at mozilla.components.browser.engine.gecko.GeckoEngineView.render(GeckoEngineView.kt:12)
... 16 more

@pocmo could this be related to https://github.com/mozilla-mobile/android-components/pull/7481 ? Is there something that Fenix should change when opening a custom tab in normal browsing?

Confirmed that this was introduced by SessionFeature changes (AFAICT) https://github.com/mozilla-mobile/fenix/commit/f863c341e81e1b4b894a6d89931cd44e773f0338

@pocmo I'm assigning you for now hoping you have an idea of what's going on here with the new SessionFeature.

Moving into our sprint.

Yeah, it looks likely that this was caused by our session feature changes. I'll investigate.

@ekager Regarding 79 release blocker: I made sure to land those changes after cutting the AC release for 79. Is the same bug really in that branch too?

Ah I just copied that over from #12350 but that makes sense

This is reproducible on Nightly 200709 GV 80 from 7/9 with Huawei P9 Lite (Android 7).

A patch just landed in AC for this. There will be a follow-up patch in Fenix needed and I am going to open a PR for that today. :)

Verified as fixed on the latest Nightly build from 7/10 (#21920613) with Google Pixel (Android 10), and Xiaomi Mi8 Lite (Android 9).

Was this page helpful?
0 / 5 - 0 ratings