Bug 1206055 - No feedback notification is displayed after tapping a link with "Open multiple links" pref enabled on Gingerbread; r=mcomella, a=lizzard
authorMartyn Haigh <mhaigh@mozilla.org>
Fri, 25 Sep 2015 17:26:53 +0100
changeset 296271 a29ec46942a5b3f4f5dc1be1b6983fa09cb59a19
parent 296270 57c9a4a0fe4ace01645bb2187ca9d221503a5a93
child 296272 b6718afe48bed9f00dec13183d4c45f0a71568f3
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella, lizzard
bugs1206055
milestone43.0a2
Bug 1206055 - No feedback notification is displayed after tapping a link with &quot;Open multiple links&quot; pref enabled on Gingerbread; r=mcomella, a=lizzard
mobile/android/base/BrowserApp.java
mobile/android/base/GeckoApp.java
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/base/tabqueue/TabQueueDispatcher.java
mobile/android/base/tabqueue/TabQueueHelper.java
mobile/android/tests/browser/robocop/testSettingsMenuItems.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -977,17 +977,17 @@ public class BrowserApp extends GeckoApp
             mDoorhangerOverlay.setVisibility(View.VISIBLE);
         }
         // We can't show the first run experience until Gecko has finished initialization (bug 1077583).
         checkFirstrun(this, new SafeIntent(getIntent()));
     }
 
     @Override
     protected void processTabQueue() {
-        if (AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized) {
+        if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized) {
             ThreadUtils.postToBackgroundThread(new Runnable() {
                 @Override
                 public void run() {
                     if (TabQueueHelper.shouldOpenTabQueueUrls(BrowserApp.this)) {
                         openQueuedTabs();
                     }
                 }
             });
@@ -3605,17 +3605,17 @@ public class BrowserApp extends GeckoApp
         }
 
         // Only solicit feedback when the app has been launched from the icon shortcut.
         if (GuestSession.NOTIFICATION_INTENT.equals(action)) {
             GuestSession.handleIntent(this, intent);
         }
 
         // If the user has clicked the tab queue notification then load the tabs.
-        if (AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized && isTabQueueAction) {
+        if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized && isTabQueueAction) {
             Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.NOTIFICATION, "tabqueue");
             ThreadUtils.postToBackgroundThread(new Runnable() {
                 @Override
                 public void run() {
                     openQueuedTabs();
                 }
             });
         }
@@ -3647,19 +3647,19 @@ public class BrowserApp extends GeckoApp
         }
     }
 
     private void showTabQueuePromptIfApplicable(final Intent intent) {
         ThreadUtils.postToBackgroundThread(new Runnable() {
             @Override
             public void run() {
                 // We only want to show the prompt if the browser has been opened from an external url
-                if (AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized
-                                                       && Intent.ACTION_VIEW.equals(intent.getAction())
-                                                       && TabQueueHelper.shouldShowTabQueuePrompt(BrowserApp.this)) {
+                if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized
+                                                     && Intent.ACTION_VIEW.equals(intent.getAction())
+                                                     && TabQueueHelper.shouldShowTabQueuePrompt(BrowserApp.this)) {
                     Intent promptIntent = new Intent(BrowserApp.this, TabQueuePrompt.class);
                     startActivityForResult(promptIntent, ACTIVITY_REQUEST_TAB_QUEUE);
                 }
             }
         });
     }
 
     @Override
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1647,17 +1647,17 @@ public abstract class GeckoApp
     protected void processActionViewIntent(final Runnable openTabsRunnable) {
         // We need to ensure that if we receive a VIEW action and there are tabs queued then the
         // site loaded from the intent is on top (last loaded) and selected with all other tabs
         // being opened behind it. We process the tab queue first and request a callback from the JS - the
         // listener will open the url from the intent as normal when the tab queue has been processed.
         ThreadUtils.postToBackgroundThread(new Runnable() {
             @Override
             public void run() {
-                if (AppConstants.MOZ_ANDROID_TAB_QUEUE && TabQueueHelper.shouldOpenTabQueueUrls(GeckoApp.this)) {
+                if (TabQueueHelper.TAB_QUEUE_ENABLED && TabQueueHelper.shouldOpenTabQueueUrls(GeckoApp.this)) {
 
                     EventDispatcher.getInstance().registerGeckoThreadListener(new NativeEventListener() {
                         @Override
                         public void handleMessage(String event, NativeJSObject message, EventCallback callback) {
                             if ("Tabs:TabsOpened".equals(event)) {
                                 EventDispatcher.getInstance().unregisterGeckoThreadListener(this, "Tabs:TabsOpened");
                                 openTabsRunnable.run();
                             }
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -25,16 +25,17 @@ import org.mozilla.gecko.R;
 import org.mozilla.gecko.RestrictedProfiles;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.TelemetryContract.Method;
 import org.mozilla.gecko.background.common.GlobalConstants;
 import org.mozilla.gecko.background.healthreport.HealthReportConstants;
 import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
 import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.tabqueue.TabQueueHelper;
 import org.mozilla.gecko.updater.UpdateService;
 import org.mozilla.gecko.updater.UpdateServiceHelper;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.InputOptionsUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.widget.FloatingHintEditText;
 
@@ -690,18 +691,17 @@ OnSharedPreferenceChangeListener
                     if (!AppConstants.MOZ_DATA_REPORTING) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (pref instanceof PanelsPreferenceCategory) {
                     mPanelsPreferenceCategory = (PanelsPreferenceCategory) pref;
                 }
-                if(AppConstants.MOZ_ANDROID_TAB_QUEUE && PREFS_CUSTOMIZE_SCREEN.equals(key)) {
-                    // Only change the customize pref screen summary on nightly builds with the tab queue build flag.
+                if(TabQueueHelper.TAB_QUEUE_ENABLED && PREFS_CUSTOMIZE_SCREEN.equals(key)) {
                     pref.setSummary(getString(R.string.pref_category_customize_alt_summary));
                 }
                 if (getResources().getString(R.string.pref_category_input_options).equals(key)) {
                     if (!InputOptionsUtils.supportsVoiceRecognizer(getApplicationContext(), getResources().getString(R.string.voicesearch_prompt)) &&
                             !InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
@@ -844,17 +844,17 @@ OnSharedPreferenceChangeListener
                     PrefHandler handler = handlers.get(key);
                     if (!handler.setupPref(this, pref)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TAB_QUEUE.equals(key)) {
                     // Only show tab queue pref on nightly builds with the tab queue build flag.
-                    if (!AppConstants.MOZ_ANDROID_TAB_QUEUE) {
+                    if (!TabQueueHelper.TAB_QUEUE_ENABLED) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_VOICE_INPUT_ENABLED.equals(key)) {
                     if (!InputOptionsUtils.supportsVoiceRecognizer(getApplicationContext(), getResources().getString(R.string.voicesearch_prompt))) {
                         // Remove UI for voice input on non nightly builds.
                         preferences.removePreference(pref);
--- a/mobile/android/base/tabqueue/TabQueueDispatcher.java
+++ b/mobile/android/base/tabqueue/TabQueueDispatcher.java
@@ -41,17 +41,17 @@ public class TabQueueDispatcher extends 
         Intent intent = getIntent();
         int flags = intent.getFlags() & ~Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
         intent.setFlags(flags);
 
         ContextUtils.SafeIntent safeIntent = new ContextUtils.SafeIntent(intent);
 
         // For the moment lets exit early and start fennec as normal if we're not in nightly with
         // the tab queue build flag.
-        if (!AppConstants.MOZ_ANDROID_TAB_QUEUE) {
+        if (!TabQueueHelper.TAB_QUEUE_ENABLED) {
             loadNormally(safeIntent.getUnsafe());
             return;
         }
 
         // Skip the Tab Queue if instructed.
         boolean shouldSkipTabQueue = safeIntent.getBooleanExtra(SKIP_TAB_QUEUE_FLAG, false);
         if (shouldSkipTabQueue) {
             loadNormally(safeIntent.getUnsafe());
--- a/mobile/android/base/tabqueue/TabQueueHelper.java
+++ b/mobile/android/base/tabqueue/TabQueueHelper.java
@@ -25,16 +25,19 @@ import android.text.TextUtils;
 import android.util.Log;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
 public class TabQueueHelper {
     private static final String LOGTAG = "Gecko" + TabQueueHelper.class.getSimpleName();
 
+    // Disable Tab Queue for API level 10 (GB) - Bug 1206055
+    public static final boolean TAB_QUEUE_ENABLED = AppConstants.Versions.feature11Plus && AppConstants.MOZ_ANDROID_TAB_QUEUE;
+
     public static final String FILE_NAME = "tab_queue_url_list.json";
     public static final String LOAD_URLS_ACTION = "TAB_QUEUE_LOAD_URLS_ACTION";
     public static final int TAB_QUEUE_NOTIFICATION_ID = R.id.tabQueueNotification;
 
     public static final String PREF_TAB_QUEUE_COUNT = "tab_queue_count";
     public static final String PREF_TAB_QUEUE_LAUNCHES = "tab_queue_launches";
     public static final String PREF_TAB_QUEUE_TIMES_PROMPT_SHOWN = "tab_queue_times_prompt_shown";
 
--- a/mobile/android/tests/browser/robocop/testSettingsMenuItems.java
+++ b/mobile/android/tests/browser/robocop/testSettingsMenuItems.java
@@ -5,16 +5,17 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Actions;
 import org.mozilla.gecko.AppConstants;
+import org.mozilla.gecko.tabqueue.TabQueueHelper;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.InputOptionsUtils;
 
 /** This patch tests the Sections present in the Settings Menu and the
  *  default values for them
  */
 public class testSettingsMenuItems extends PixelTest {
     // Customize menu items.
@@ -193,17 +194,17 @@ public class testSettingsMenuItems exten
 
         // Automatic updates
         if (AppConstants.MOZ_UPDATER) {
             String[] autoUpdateUi = { mStringHelper.DOWNLOAD_UPDATES_AUTO, mStringHelper.OVER_WIFI_OPTION, mStringHelper.ALWAYS, mStringHelper.OVER_WIFI_OPTION, mStringHelper.NEVER };
             settingsMap.get(PATH_CUSTOMIZE).add(autoUpdateUi);
         }
 
         // Tab Queue
-        if (AppConstants.MOZ_ANDROID_TAB_QUEUE) {
+        if (TabQueueHelper.TAB_QUEUE_ENABLED) {
             final String[] tabQueue = { mStringHelper.TAB_QUEUE_LABEL, mStringHelper.TAB_QUEUE_SUMMARY };
             settingsMap.get(PATH_CUSTOMIZE).add(tabQueue);
         }
 
         // Crash reporter
         if (AppConstants.MOZ_CRASHREPORTER) {
             String[] crashReporterUi = { mStringHelper.CRASH_REPORTER, mStringHelper.CRASH_REPORTER_MSG};
             settingsMap.get(PATH_MOZILLA).add(crashReporterUi);