Bug 1387026 - Fix Android browserAction corrupting legacy Addon menu items on overlapping menu item id. r=sebastian
authorLuca Greco <lgreco@mozilla.com>
Wed, 02 Aug 2017 21:29:18 +0200
changeset 372928 2d15b3c8b58caa1beed80c036d7c43d2f74b7a5a
parent 372927 3af71fa1f3dd1cf6083f84612c2fb99ed765d2fb
child 372929 1256610b4f380b2b1b064252ccda925f097b3575
push id48040
push userluca.greco@alcacoop.it
push dateFri, 04 Aug 2017 16:24:38 +0000
treeherderautoland@2d15b3c8b58c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1387026
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1387026 - Fix Android browserAction corrupting legacy Addon menu items on overlapping menu item id. r=sebastian 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
@@ -255,16 +255,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;
 
@@ -1859,17 +1860,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;