commit 1666b0186346ab2769614d3b19bc2058fd6f13f0 Author: Matthew Finkel Matthew.Finkel@gmail.com Date: Tue May 28 01:58:14 2019 +0000
Revert "Bug 28507: Parse a set of strings in Android Set Preferences"
This reverts commit 894c64799812159b17ee90ca39427d12999a670d. --- .../gecko/preferences/DistroSharedPrefsImport.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java b/mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java index 7969aca3d2ac..13047c6f2ff4 100644 --- a/mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java +++ b/mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java @@ -11,13 +11,10 @@ import org.mozilla.gecko.distribution.Distribution; import android.content.Context; import android.content.SharedPreferences; import android.util.Log; -import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;
-import java.util.HashSet; import java.util.Iterator; -import java.util.Set;
public class DistroSharedPrefsImport {
@@ -61,21 +58,7 @@ public class DistroSharedPrefsImport { } else if (value instanceof Long) { sharedPreferences.putLong(GeckoPreferences.NON_PREF_PREFIX + key, (long) value); } else { - JSONArray jsonArray = preferences.optJSONArray(key); - if (jsonArray != null) { - Set<String> prefValues = new HashSet<String>(); - for (int i = 0; i < jsonArray.length(); i++) { - try { - prefValues.add(jsonArray.getString(i)); - } catch (JSONException e) { - Log.e(LOGTAG, "Unable to parse Android Preferences.", e); - continue; - } - } - sharedPreferences.putStringSet(GeckoPreferences.NON_PREF_PREFIX + key, prefValues); - } else { - Log.d(LOGTAG, "Unknown preference value type whilst importing android preferences from distro file."); - } + Log.d(LOGTAG, "Unknown preference value type whilst importing android preferences from distro file."); } } sharedPreferences.apply();