Bug 1295675 - Check profilePref's length before applying preferences. r?mkaply
MozReview-Commit-ID: Kt4xaZ77DaA
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java
@@ -26,17 +26,17 @@ public class DistroSharedPrefsImport {
}
// There are two types of preferences : Application-scoped and profile-scoped (bug 1295675)
final JSONObject appPref = distribution.getPreferences(Distribution.PREF_KEY_APPLICATION_PREFERENCES);
if (appPref.length() != 0) {
applyPreferences(appPref, GeckoSharedPrefs.forApp(context).edit());
}
final JSONObject profilePref = distribution.getPreferences(Distribution.PREF_KEY_PROFILE_PREFERENCES);
- if (appPref.length() != 0) {
+ if (profilePref.length() != 0) {
applyPreferences(profilePref, GeckoSharedPrefs.forProfile(context).edit());
}
}
private static void applyPreferences(JSONObject preferences, SharedPreferences.Editor sharedPreferences) {
final Iterator<?> keys = preferences.keys();
while (keys.hasNext()) {
final String key = (String) keys.next();