Bug 1387026 - Fix Android browserAction corrupting legacy Addon menu items on overlapping menu item id. r=sebastian, a=lizzard
authorLuca Greco <lgreco@mozilla.com>
Wed, 02 Aug 2017 21:29:18 +0200
changeset 421130 0f875d25932a5ffec9c9abc05c0f899a6990bdf8
parent 421129 71154d26091a721d399b9d8ab0eb03c5e306d63d
child 421131 c4ab1285bf4064ab83c82d36d3f3ae3e42bdad63
push id7608
push userryanvm@gmail.com
push dateMon, 14 Aug 2017 01:26:10 +0000
treeherdermozilla-beta@1ad3a57bcf6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian, lizzard
bugs1387026
milestone56.0
Bug 1387026 - Fix Android browserAction corrupting legacy Addon menu items on overlapping menu item id. r=sebastian, a=lizzard MozReview-Commit-ID: FWkJdAWu5Td
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -250,16 +250,17 @@ public class BrowserApp extends GeckoApp
      */
     private ViewGroup mHomeScreenContainer;
     private int mCachedRecentTabsCount;
     private ActionModeCompat mActionMode;
     private TabHistoryController tabHistoryController;
 
     private static final int GECKO_TOOLS_MENU = -1;
     private static final int ADDON_MENU_OFFSET = 1000;
+    private static final int BROWSER_ACTION_MENU_OFFSET = 10000;
     public static final String TAB_HISTORY_FRAGMENT_TAG = "tabHistoryFragment";
 
     // When the static action bar is shown, only the real toolbar chrome should be
     // shown when the toolbar is visible. Causing the toolbar animator to also
     // show the snapshot causes the content to shift under the users finger.
     // See: Bug 1358554
     private boolean mShowingToolbarChromeForActionBar;
 
@@ -1854,17 +1855,17 @@ public class BrowserApp extends GeckoApp
 
             case "Menu:AddBrowserAction":
                 final BrowserActionItemInfo browserAction = new BrowserActionItemInfo();
                 browserAction.label = message.getString("name");
                 if (TextUtils.isEmpty(browserAction.label)) {
                     Log.e(LOGTAG, "Invalid browser action name");
                     return;
                 }
-                browserAction.id = message.getInt("id") + ADDON_MENU_OFFSET;
+                browserAction.id = message.getInt("id") + BROWSER_ACTION_MENU_OFFSET;
                 browserAction.uuid = message.getString("uuid");
                 addBrowserActionMenuItem(browserAction);
                 break;
 
             case "Menu:RemoveBrowserAction":
                 removeBrowserActionMenuItem(message.getString("uuid"));
                 break;