Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
21bd3794
Commit
21bd3794
authored
May 26, 2020
by
Sebastian Kaspari
Browse files
Issue #9815: Allow Intents to set HomeActivity.OPEN_TO_BROWSER.
parent
d54dbce7
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
View file @
21bd3794
...
...
@@ -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
...
...
app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
View file @
21bd3794
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment