Bug 1295675 - Check profilePref's length before applying preferences. r?mkaply draft
authorNevin Chen <cnevinchen@gmail.com>
Tue, 28 Mar 2017 16:57:45 +0800
changeset 552336 e641e46c882ec2eb8b1e09cfc75b8106bffc73d0
parent 552314 b0eed566a4d1436186559f882f24974fc8bae5b2
child 621784 e5a2bcf634fd4fd9bf17d867c12d926605dc7b7b
push id51318
push userbmo:cnevinchen@gmail.com
push dateTue, 28 Mar 2017 09:15:26 +0000
reviewersmkaply
bugs1295675
milestone55.0a1
Bug 1295675 - Check profilePref's length before applying preferences. r?mkaply MozReview-Commit-ID: Kt4xaZ77DaA
mobile/android/base/java/org/mozilla/gecko/preferences/DistroSharedPrefsImport.java
--- 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();