backout 95849d209a1f (Bug 975525) for crashes. r=backout
authorWes Johnston <wjohnston@mozilla.com>
Mon, 24 Feb 2014 08:44:56 -0800
changeset 170418 069f663e7e6426f000af5e673a71837752785205
parent 170417 b96e4b7e4be6bf2b4a63e5a73f3aa6581d7af953
child 170419 7fd003a98b5527ece9e6e6f3cdce062dbc90a16d
push id26288
push userryanvm@gmail.com
push dateTue, 25 Feb 2014 20:20:43 +0000
treeherdermozilla-central@22650589a724 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs975525
milestone30.0a1
backs out95849d209a1f1021bc7f70b98d499947cc040d41
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
backout 95849d209a1f (Bug 975525) for crashes. r=backout
mobile/android/base/GeckoApp.java
mobile/android/base/menu/GeckoMenu.java
mobile/android/base/menu/GeckoMenuItem.java
mobile/android/base/widget/ActivityChooserModel.java
mobile/android/base/widget/GeckoActionProvider.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -411,22 +411,18 @@ public abstract class GeckoApp
             return onCreateOptionsMenu(menu);
         }
 
         return super.onCreatePanelMenu(featureId, menu);
     }
 
     @Override
     public boolean onPreparePanel(int featureId, View view, Menu menu) {
-        if (Build.VERSION.SDK_INT >= 11 && featureId == Window.FEATURE_OPTIONS_PANEL) {
-            if (menu instanceof GeckoMenu) {
-                ((GeckoMenu) menu).refresh();
-            }
+        if (Build.VERSION.SDK_INT >= 11 && featureId == Window.FEATURE_OPTIONS_PANEL)
             return onPrepareOptionsMenu(menu);
-        }
 
         return super.onPreparePanel(featureId, view, menu);
     }
 
     @Override
     public boolean onMenuOpened(int featureId, Menu menu) {
         // exit full-screen mode whenever the menu is opened
         if (mLayerView != null && mLayerView.isFullScreen()) {
--- a/mobile/android/base/menu/GeckoMenu.java
+++ b/mobile/android/base/menu/GeckoMenu.java
@@ -21,17 +21,16 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.BaseAdapter;
 import android.widget.LinearLayout;
 import android.widget.ListView;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
 public class GeckoMenu extends ListView 
                        implements Menu,
                                   AdapterView.OnItemClickListener,
                                   GeckoMenuItem.OnShowAsActionChangedListener {
     private static final String LOGTAG = "GeckoMenu";
@@ -632,28 +631,16 @@ public class GeckoMenu extends ListView
             if (indexOfChild(actionItem) != -1) {
                 LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) actionItem.getLayoutParams();
                 mWeightSum -= params.weight;
                 removeView(actionItem);
             }
         }
     }
 
-    public void refresh() {
-        for (Iterator<GeckoMenuItem> i = mPrimaryActionItems.keySet().iterator(); i.hasNext();) {
-            GeckoMenuItem item = i.next();
-            item.refreshIfChanged();
-        }
-
-        for (Iterator<GeckoMenuItem> i = mSecondaryActionItems.keySet().iterator(); i.hasNext();) {
-            GeckoMenuItem item = i.next();
-            item.refreshIfChanged();
-        }
-    }
-
     // Adapter to bind menu items to the list.
     private class MenuItemsAdapter extends BaseAdapter {
         private static final int VIEW_TYPE_DEFAULT = 0;
         private static final int VIEW_TYPE_ACTION_MODE = 1;
 
         private List<GeckoMenuItem> mItems;
 
         public MenuItemsAdapter() {
--- a/mobile/android/base/menu/GeckoMenuItem.java
+++ b/mobile/android/base/menu/GeckoMenuItem.java
@@ -217,27 +217,16 @@ public class GeckoMenuItem implements Me
                 }
             });
         }
 
         mShowAsActionChangedListener.onShowAsActionChanged(this);
         return this;
     }
 
-    public void refreshIfChanged() {
-        if (mActionProvider == null)
-            return;
-
-        if (mActionProvider instanceof GeckoActionProvider) {
-            if (((GeckoActionProvider) mActionProvider).hasChanged()) {
-                mShowAsActionChangedListener.onShowAsActionChanged(GeckoMenuItem.this);
-            }
-        }
-    }
-
     @Override
     public MenuItem setActionView(int resId) {
         return this;
     }
 
     @Override
     public MenuItem setActionView(View view) {
         return this;
--- a/mobile/android/base/widget/ActivityChooserModel.java
+++ b/mobile/android/base/widget/ActivityChooserModel.java
@@ -314,18 +314,16 @@ public class ActivityChooserModel extend
      */
     private boolean mHistoricalRecordsChanged = true;
 
     /**
      * Flag whether to reload the activities for the current intent.
      */
     private boolean mReloadActivities = false;
 
-    private long mLastChanged = 0;
-
     /**
      * Policy for controlling how the model handles chosen activities.
      */
     private OnChooseActivityListener mActivityChoserModelPolicy;
 
     /**
      * Gets the data model backed by the contents of the provided file with historical data.
      * Note that only one data model is backed by a given file, thus multiple calls with
@@ -742,17 +740,16 @@ public class ActivityChooserModel extend
             mActivities.clear();
             List<ResolveInfo> resolveInfos = mContext.getPackageManager()
                     .queryIntentActivities(mIntent, 0);
             final int resolveInfoCount = resolveInfos.size();
             for (int i = 0; i < resolveInfoCount; i++) {
                 ResolveInfo resolveInfo = resolveInfos.get(i);
                 mActivities.add(new ActivityResolveInfo(resolveInfo));
             }
-            mLastChanged = System.currentTimeMillis();
             return true;
         }
         return false;
     }
 
     /**
      * Reads the historical data if necessary which is it has
      * changed, there is a history file, and there is not persist
@@ -1218,16 +1215,12 @@ public class ActivityChooserModel extend
         public void onReceive(Context context, Intent intent) {
             String action = intent.getAction();
             if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
                 String packageName = intent.getData().getSchemeSpecificPart();
                 removeHistoricalRecordsForPackage(packageName);
             }
 
             mReloadActivities = true;
-            mLastChanged = System.currentTimeMillis();
         }
     }
+}
 
-    public long getLastChanged() {
-        return mLastChanged;
-    }
-}
--- a/mobile/android/base/widget/GeckoActionProvider.java
+++ b/mobile/android/base/widget/GeckoActionProvider.java
@@ -16,17 +16,16 @@ import android.view.ActionProvider;
 import android.view.MenuItem;
 import android.view.MenuItem.OnMenuItemClickListener;
 import android.view.SubMenu;
 import android.view.View;
 import android.view.View.OnClickListener;
 
 public class GeckoActionProvider extends ActionProvider {
     private static int MAX_HISTORY_SIZE = 2;
-    private long mLastChanged = 0;
 
     /**
      * A listener to know when a target was selected.
      * When setting a provider, the activity can listen to this,
      * to close the menu.
      */
     public interface OnTargetSelectedListener {
         public void onTargetSelected();
@@ -75,24 +74,16 @@ public class GeckoActionProvider extends
 
         return view;
     }
 
     public View getView() {
         return onCreateActionView();
     }
 
-    public boolean hasChanged() {
-        ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
-        long lastChanged = dataModel.getLastChanged();
-        boolean ret = lastChanged != mLastChanged;
-        mLastChanged = lastChanged;
-        return ret;
-    }
-
     @Override
     public boolean hasSubMenu() {
         return true;
     }
 
     @Override
     public void onPrepareSubMenu(SubMenu subMenu) {
         // Clear since the order of items may change.