From 00bd26abe3c80060e5a7fc07c23d2cb930a0ab4e Mon Sep 17 00:00:00 2001 From: Yeon Taek Jeong Date: Tue, 6 Aug 2019 15:02:17 -0700 Subject: [PATCH] Remove task flags --- .../java/org/mozilla/fenix/HomeActivity.kt | 5 ----- .../mozilla/fenix/IntentReceiverActivity.kt | 18 +++++------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index be59d5a6d..400db2995 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -134,11 +134,6 @@ open class HomeActivity : AppCompatActivity(), ShareFragment.TabsSharedCallback override fun onNewIntent(intent: Intent?) { super.onNewIntent(intent) handleCrashIfNecessary(intent) - intent?.run { - if (this.flags and Intent.FLAG_ACTIVITY_CLEAR_TASK != 0) { - return - } - } handleOpenedFromExternalSourceIfNecessary(intent) } diff --git a/app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt b/app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt index e034cd12d..e24956875 100644 --- a/app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt @@ -71,19 +71,11 @@ class IntentReceiverActivity : Activity() { } intent.action == Intent.ACTION_VIEW || intent.action == Intent.ACTION_SEND -> { intent.setClassName(applicationContext, HomeActivity::class.java.name) - if ((intent.flags and Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) { - // This Intent was launched from history (recent apps). Android will redeliver the - // original Intent (which might be a VIEW intent). However if there's no active browsing - // session then we do not want to re-process the Intent and potentially re-open a website - // from a session that the user already "erased". - false - } else { - if (!intent.getBooleanExtra(NotificationManager.RECEIVE_TABS_TAG, false)) { - intent.flags = - Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK - } - true - } + // This Intent was launched from history (recent apps). Android will redeliver the + // original Intent (which might be a VIEW intent). However if there's no active browsing + // session then we do not want to re-process the Intent and potentially re-open a website + // from a session that the user already "erased". + intent.flags and Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY == 0 } else -> { intent.setClassName(applicationContext, HomeActivity::class.java.name)