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

fennec/production
Sebastian Kaspari 4 years ago
parent d54dbce7ba
commit 21bd379438

@ -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,

Loading…
Cancel
Save