Bug 1280112 - LauncherActivity: Remove task flags from incoming intent. r=ahunt
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 06 Sep 2016 17:58:46 +0200
changeset 313051 25ae9569214c417b14a53f94cbf32fa55b0d8ba1
parent 313050 87880c0f7336cae145e4e867aa3b68eff9896ba3
child 313052 ab12d34f31451576d5891b2262270dc758b3607f
push id20479
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 01:08:46 +0000
treeherderfx-team@fb7c6b034329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahunt
bugs1280112
milestone51.0a1
Bug 1280112 - LauncherActivity: Remove task flags from incoming intent. r=ahunt MozReview-Commit-ID: 8ufNtiMc1sj
mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
@@ -63,16 +63,22 @@ public class LauncherActivity extends Ac
     }
 
     /**
      * Launch the browser activity.
      */
     private void dispatchNormalIntent() {
         Intent intent = new Intent(getIntent());
         intent.setClassName(getApplicationContext(), AppConstants.MOZ_ANDROID_BROWSER_INTENT_CLASS);
+
+        // 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). See bug 1280112.
+        intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK);
+        intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_CLEAR_TASK);
+
         startActivity(intent);
     }
 
     private void dispatchCustomTabsIntent() {
         Intent intent = new Intent(getIntent());
         intent.setClassName(getApplicationContext(), CustomTabsActivity.class.getName());
         startActivity(intent);
     }