Bug 1196198 - Use ordered list to find new default panel. r=mhaigh a=sylvestre
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 31 Aug 2015 14:26:46 +0200
changeset 289121 125fb532285479feaffb06fb09c40a3e37ccefae
parent 289120 e96c99debcb639585f69daaefc5882040b4c722f
child 289122 408b19349d5a8267a5e4fb90e767eed9fd2f7f52
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh, sylvestre
bugs1196198
milestone42.0a2
Bug 1196198 - Use ordered list to find new default panel. r=mhaigh a=sylvestre
mobile/android/base/home/HomeConfig.java
--- a/mobile/android/base/home/HomeConfig.java
+++ b/mobile/android/base/home/HomeConfig.java
@@ -22,16 +22,17 @@ import org.mozilla.gecko.GeckoEvent;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.mozglue.RobocopTarget;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.content.Context;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.text.TextUtils;
+import android.util.Log;
 
 public final class HomeConfig {
     /**
      * Used to determine what type of HomeFragment subclass to use when creating
      * a given panel. With the exception of DYNAMIC, all of these types correspond
      * to a default set of built-in panels. The DYNAMIC panel type is used by
      * third-party services to create panels with varying types of content.
      */
@@ -1213,17 +1214,17 @@ public final class HomeConfig {
             }
 
             return mDefaultPanel.equals(panelConfig);
         }
 
         private void findNewDefault() {
             // Pick the first panel that is neither disabled nor currently
             // set as default.
-            for (PanelConfig panelConfig : mConfigMap.values()) {
+            for (PanelConfig panelConfig : makeOrderedCopy(false)) {
                 if (!panelConfig.isDefault() && !panelConfig.isDisabled()) {
                     setDefault(panelConfig.getId());
                     return;
                 }
             }
 
             mDefaultPanel = null;
         }