1
0
Fork 0

For #2893, #2673, #2916, #2314: Fix race condition navigating to browser (#3023)

Since the Navigation library restores the fragment after memory eviction, if we're already on the BrowserFragment and we deep link navigate to the BrowserFragment, we briefly get two of them. This crashes GeckoView.
master
Colin Lee 2019-05-30 17:43:32 -05:00 committed by GitHub
parent 8d0174fff2
commit 72c5cb304c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -64,4 +64,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #654 - Updated Refresh button to turn into Stop button while menu is open.
- [AC #2725](https://github.com/mozilla-mobile/android-components/issues/2725) Updated tracking protectionPolicy to [recommend](https://github.com/mozilla-mobile/android-components/blob/master/components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineSession.kt#L156)
- #2789 Custom tabs is not covering the full screen size.
- #2893, #2673, #2916, #2314: Fix several crashes navigating from external links
### Removed

View File

@ -156,7 +156,8 @@ open class HomeActivity : AppCompatActivity() {
}
private fun handleOpenedFromExternalSourceIfNecessary(intent: Intent?) {
if (intent?.extras?.getBoolean(OPEN_TO_BROWSER) != true) { return }
if (navHost.navController.currentDestination?.id == R.id.browserFragment) return
if (intent?.extras?.getBoolean(OPEN_TO_BROWSER) != true) return
this.intent.putExtra(OPEN_TO_BROWSER, false)
var customTabSessionId: String? = null