parent
da0148b8bd
commit
0630e2482f
|
@ -108,7 +108,14 @@
|
|||
android:taskAffinity=""
|
||||
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />
|
||||
|
||||
<activity android:name=".IntentReceiverActivity" android:theme="@style/Theme.Transparent">
|
||||
<activity
|
||||
android:name=".IntentReceiverActivity"
|
||||
android:theme="@style/Theme.Transparent"
|
||||
android:relinquishTaskIdentity="true"
|
||||
android:taskAffinity=""
|
||||
android:exported="true"
|
||||
android:excludeFromRecents="true" >
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
|
|
|
@ -57,6 +57,15 @@ class IntentReceiverActivity : Activity() {
|
|||
modeDependentProcessors +
|
||||
NewTabShortcutIntentProcessor()
|
||||
|
||||
// Explicitly remove the new task and clear task flags (Our browser activity is a single
|
||||
// task activity and we never want to start a second task here).
|
||||
intent.flags = intent.flags and Intent.FLAG_ACTIVITY_NEW_TASK.inv()
|
||||
intent.flags = intent.flags and Intent.FLAG_ACTIVITY_CLEAR_TASK.inv()
|
||||
|
||||
// IntentReceiverActivity is started with the "excludeFromRecents" flag (set in manifest). We
|
||||
// do not want to propagate this flag from the intent receiver activity to the browser.
|
||||
intent.flags = intent.flags and Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.inv()
|
||||
|
||||
// Call process for side effects, short on the first that returns true
|
||||
intentProcessors.any { it.process(intent) }
|
||||
|
||||
|
@ -66,8 +75,8 @@ class IntentReceiverActivity : Activity() {
|
|||
intent.setClassName(applicationContext, intentProcessorType.activityClassName)
|
||||
intent.putExtra(HomeActivity.OPEN_TO_BROWSER, intentProcessorType.shouldOpenToBrowser(intent))
|
||||
|
||||
// finish() before starting another activity. Don't keep this on the activities back stack.
|
||||
finish()
|
||||
startActivity(intent)
|
||||
// must finish() after starting the other activity
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,7 +191,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
|
|||
},
|
||||
openInFenixIntent = Intent(context, IntentReceiverActivity::class.java).apply {
|
||||
action = Intent.ACTION_VIEW
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
},
|
||||
bookmarkTapped = { lifecycleScope.launch { bookmarkTapped(it) } },
|
||||
scope = lifecycleScope,
|
||||
|
|
Loading…
Reference in New Issue