parent
6ccd32f093
commit
7481d52c4b
|
@ -9,6 +9,7 @@ import android.content.Intent
|
|||
import android.os.Bundle
|
||||
import mozilla.components.browser.session.tab.CustomTabConfig
|
||||
import mozilla.components.support.utils.SafeIntent
|
||||
import org.mozilla.fenix.components.NotificationManager.Companion.RECEIVE_TABS_TAG
|
||||
import org.mozilla.fenix.customtabs.CustomTabActivity
|
||||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.utils.Settings
|
||||
|
@ -38,7 +39,9 @@ class IntentReceiverActivity : Activity() {
|
|||
}
|
||||
intent.action == Intent.ACTION_VIEW -> {
|
||||
intent.setClassName(applicationContext, HomeActivity::class.java.name)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
if (!intent.getBooleanExtra(RECEIVE_TABS_TAG, false)) {
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
}
|
||||
true
|
||||
}
|
||||
else -> {
|
||||
|
|
|
@ -55,7 +55,10 @@ class NotificationManager(private val context: Context) {
|
|||
logger.debug("Showing ${event.entries.size} tab(s) received from deviceID=${event.from?.id}")
|
||||
event.entries.forEach { tab ->
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(tab.url))
|
||||
val pendingIntent: PendingIntent = PendingIntent.getActivity(context, 0, intent, 0)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
intent.putExtra(RECEIVE_TABS_TAG, true)
|
||||
val pendingIntent: PendingIntent =
|
||||
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT)
|
||||
|
||||
val builder = NotificationCompat.Builder(context, RECEIVE_TABS_CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_status_logo)
|
||||
|
|
Loading…
Reference in New Issue