Bug 968172 - Rename PREFS_KEY constant to PREFS_CONFIG_KEY (r=rnewman)
authorLucas Rocha <lucasr@mozilla.com>
Fri, 21 Feb 2014 10:47:44 +0000
changeset 170376 0304dd8dc1d96f9d4404f035085aab49b73485f2
parent 170375 5e50f61a7c9be066bf80db79e9d3e3eeebaadf53
child 170377 e0a8e36904bf6493383a04e61cf6b2dc4ef1229b
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersrnewman
bugs968172
milestone30.0a1
Bug 968172 - Rename PREFS_KEY constant to PREFS_CONFIG_KEY (r=rnewman)
mobile/android/base/home/HomeConfigPrefsBackend.java
--- a/mobile/android/base/home/HomeConfigPrefsBackend.java
+++ b/mobile/android/base/home/HomeConfigPrefsBackend.java
@@ -28,17 +28,17 @@ import android.util.Log;
 
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.List;
 
 class HomeConfigPrefsBackend implements HomeConfigBackend {
     private static final String LOGTAG = "GeckoHomeConfigBackend";
 
-    private static final String PREFS_KEY = "home_panels";
+    private static final String PREFS_CONFIG_KEY = "home_panels";
 
     private final Context mContext;
     private PrefsListener mPrefsListener;
     private OnChangeListener mChangeListener;
 
     public HomeConfigPrefsBackend(Context context) {
         mContext = context;
     }
@@ -99,17 +99,17 @@ class HomeConfigPrefsBackend implements 
         }
 
         return panelConfigs;
     }
 
     @Override
     public List<PanelConfig> load() {
         final SharedPreferences prefs = getSharedPreferences();
-        final String jsonString = prefs.getString(PREFS_KEY, null);
+        final String jsonString = prefs.getString(PREFS_CONFIG_KEY, null);
 
         final List<PanelConfig> panelConfigs;
         if (TextUtils.isEmpty(jsonString)) {
             panelConfigs = loadDefaultConfig();
         } else {
             panelConfigs = loadConfigFromString(jsonString);
         }
 
@@ -130,17 +130,17 @@ class HomeConfigPrefsBackend implements 
                 Log.e(LOGTAG, "Exception converting PanelConfig to JSON", e);
             }
         }
 
         final SharedPreferences prefs = getSharedPreferences();
         final SharedPreferences.Editor editor = prefs.edit();
 
         final String jsonString = jsonPanelConfigs.toString();
-        editor.putString(PREFS_KEY, jsonString);
+        editor.putString(PREFS_CONFIG_KEY, jsonString);
         editor.commit();
     }
 
     @Override
     public void setOnChangeListener(OnChangeListener listener) {
         final SharedPreferences prefs = getSharedPreferences();
 
         if (mChangeListener != null) {
@@ -154,14 +154,14 @@ class HomeConfigPrefsBackend implements 
             mPrefsListener = new PrefsListener();
             prefs.registerOnSharedPreferenceChangeListener(mPrefsListener);
         }
     }
 
     private class PrefsListener implements OnSharedPreferenceChangeListener {
         @Override
         public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
-            if (TextUtils.equals(key, PREFS_KEY)) {
+            if (TextUtils.equals(key, PREFS_CONFIG_KEY)) {
                 mChangeListener.onChange();
             }
         }
     }
 }