Bug 1196198 - Use ordered list to find new default panel. r=mhaigh
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 31 Aug 2015 14:26:46 +0200
changeset 294841 9af574254ea0f28eb8269d92c290150dda28bd1d
parent 294840 ea037342780d19a8e539c755f3be46a90bc3f77e
child 294842 9fff9644e1a087ff33d0f792788d01b839bbde95
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1196198
milestone43.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 1196198 - Use ordered list to find new default panel. r=mhaigh
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.GeckoAppShell;
 import org.mozilla.gecko.GeckoEvent;
 import org.mozilla.gecko.R;
 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;
         }