Commit 21bd3794 authored by Sebastian Kaspari's avatar Sebastian Kaspari
Browse files

Issue #9815: Allow Intents to set HomeActivity.OPEN_TO_BROWSER.

parent d54dbce7
......@@ -50,7 +50,13 @@ class IntentReceiverActivity : Activity() {
private fun launch(intent: Intent, intentProcessorType: IntentProcessorType) {
intent.setClassName(applicationContext, intentProcessorType.activityClassName)
intent.putExtra(HomeActivity.OPEN_TO_BROWSER, intentProcessorType.shouldOpenToBrowser(intent))
if (!intent.hasExtra(HomeActivity.OPEN_TO_BROWSER)) {
intent.putExtra(
HomeActivity.OPEN_TO_BROWSER,
intentProcessorType.shouldOpenToBrowser(intent)
)
}
startActivity(intent)
finish() // must finish() after starting the other activity
......
......@@ -205,6 +205,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
customTabSession = customTabSessionId?.let { sessionManager.findSessionById(it) },
openInFenixIntent = Intent(context, IntentReceiverActivity::class.java).apply {
action = Intent.ACTION_VIEW
putExtra(HomeActivity.OPEN_TO_BROWSER, true)
},
bookmarkTapped = { viewLifecycleOwner.lifecycleScope.launch { bookmarkTapped(it) } },
scope = viewLifecycleOwner.lifecycleScope,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment