2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] No issue: Store the Custom Tab Session ID to avoid a crash (https://github.com/mozilla-mobile/fenix/pull/3062)

This commit is contained in:
Colin Lee 2019-05-31 17:03:58 -05:00 committed by GitHub
parent 0d07b7f477
commit b095f86cbf

View File

@ -547,6 +547,16 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
}
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putString(KEY_CUSTOM_TAB_SESSION_ID, customTabSessionId)
}
override fun onViewStateRestored(savedInstanceState: Bundle?) {
super.onViewStateRestored(savedInstanceState)
customTabSessionId = savedInstanceState?.getString(KEY_CUSTOM_TAB_SESSION_ID)
}
override fun onStop() {
super.onStop()
sessionObserver?.let {
@ -823,6 +833,7 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
companion object {
private const val SHARED_TRANSITION_MS = 200L
private const val TAB_ITEM_TRANSITION_NAME = "tab_item"
private const val KEY_CUSTOM_TAB_SESSION_ID = "custom_tab_session_id"
private const val REQUEST_CODE_DOWNLOAD_PERMISSIONS = 1
private const val REQUEST_CODE_PROMPT_PERMISSIONS = 2
private const val REQUEST_CODE_APP_PERMISSIONS = 3