Disable ActionBar animations pending more involved fix

Recycling of ActionBar items can cause problems with the current
ActionBar animations, as the system animates views that represent both
pre- and post-layout changes, sometimes causing opposit animations to
run on the same view, resulting in unpredictable effect slike views
remaining invisible.

This 'fix' is a workaround to disable item animations pending a more
complete and robust fix that involves a more involved system of view
recycling that would avoid recycling views that are currently being used
in animations.

Issue #20538912 Menu missing in Downloads app

Change-Id: I7b1d3baf94378e4788f868801a452c6583353842
diff --git a/core/java/android/widget/ActionMenuPresenter.java b/core/java/android/widget/ActionMenuPresenter.java
index e0b0e1f..f08141c 100644
--- a/core/java/android/widget/ActionMenuPresenter.java
+++ b/core/java/android/widget/ActionMenuPresenter.java
@@ -61,6 +61,7 @@
         implements ActionProvider.SubUiVisibilityListener {
     private static final String TAG = "ActionMenuPresenter";
     private static final int ITEM_ANIMATION_DURATION = 150;
+    private static final boolean ACTIONBAR_ANIMATIONS_ENABLED = false;
 
     private OverflowMenuButton mOverflowButton;
     private boolean mReserveOverflow;
@@ -414,7 +415,7 @@
     @Override
     public void updateMenuView(boolean cleared) {
         final ViewGroup menuViewParent = (ViewGroup) ((View) mMenuView).getParent();
-        if (menuViewParent != null) {
+        if (menuViewParent != null && ACTIONBAR_ANIMATIONS_ENABLED) {
             setupItemAnimations();
         }
         super.updateMenuView(cleared);