Bug 1251362 - Part 18 - Migrate (customised) home panel configurations. r=liuche draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 21 May 2016 14:39:15 +0200
changeset 376086 412e23f55dce09e4f1be247e13511b0b78156591
parent 376085 897a683685f972d5bd753e8086ab7c1db6508e0b
child 376087 48b7556c94e3c99ac36da7e7417484d4b3855b59
push id20500
push usermozilla@buttercookie.de
push dateTue, 07 Jun 2016 11:41:20 +0000
reviewersliuche
bugs1251362
milestone50.0a1
Bug 1251362 - Part 18 - Migrate (customised) home panel configurations. r=liuche For people with customised home panels, we need to explicitly remove the Recent Tabs panel. We also unhide the Combined History panel if it was previously hidden and additionally turn it into the default panel if the Recent Tabs panel was the previous default panel. MozReview-Commit-ID: 5CSJUTRysQU
mobile/android/base/java/org/mozilla/gecko/home/HomeConfigPrefsBackend.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/HomeConfigPrefsBackend.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HomeConfigPrefsBackend.java
@@ -30,17 +30,17 @@ import android.content.SharedPreferences
 import android.support.v4.content.LocalBroadcastManager;
 import android.text.TextUtils;
 import android.util.Log;
 
 public class HomeConfigPrefsBackend implements HomeConfigBackend {
     private static final String LOGTAG = "GeckoHomeConfigBackend";
 
     // Increment this to trigger a migration.
-    private static final int VERSION = 6;
+    private static final int VERSION = 7;
 
     // This key was originally used to store only an array of panel configs.
     public static final String PREFS_CONFIG_KEY_OLD = "home_panels";
 
     // This key is now used to store a version number with the array of panel configs.
     public static final String PREFS_CONFIG_KEY = "home_panels_with_version";
 
     // Keys used with JSON object stored in prefs.
@@ -398,16 +398,21 @@ public class HomeConfigPrefsBackend impl
                     // This is the fix for bug 1264136 where we lost track of the default panel during some migrations.
                     ensureDefaultPanelForV5(context, jsonPanels);
                     break;
 
                 case 6:
                     jsonPanels = removePanel(context, jsonPanels,
                             PanelType.DEPRECATED_READING_LIST, PanelType.BOOKMARKS, false);
                     break;
+
+                case 7:
+                    jsonPanels = removePanel(context, jsonPanels,
+                            PanelType.RECENT_TABS, PanelType.COMBINED_HISTORY, true);
+                    break;
             }
         }
 
         // Save the new panel config and the new version number.
         final JSONObject newJson = new JSONObject();
         newJson.put(JSON_KEY_PANELS, jsonPanels);
         newJson.put(JSON_KEY_VERSION, VERSION);