Loading mobile/android/base/java/org/mozilla/gecko/distribution/Distribution.java +21 −0 Original line number Diff line number Diff line Loading @@ -43,7 +43,9 @@ import org.mozilla.gecko.EventDispatcher; import org.mozilla.gecko.GeckoAppShell; import org.mozilla.gecko.GeckoApplication; import org.mozilla.gecko.GeckoSharedPrefs; import org.mozilla.gecko.preferences.DistroSharedPrefsImport; import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.preferences.GeckoPreferences; import org.mozilla.gecko.util.FileUtils; import org.mozilla.gecko.util.GeckoBundle; import org.mozilla.gecko.util.HardwareUtils; Loading Loading @@ -247,6 +249,18 @@ public class Distribution { data = new GeckoBundle(1); data.putString("preferences", preferencesJSON); // Only overwrite the current preferences if we upgraded. // This isn't the best behavior because if the user // changed one of the preferences, then this overwrites // it. What we really want is a feature where we can // set a new preference if the current value wasn't // user-modified. This implementation doesn't support // something like that. #28842 final SharedPreferences settings = distribution.getSharedPreferences(); if (!AppConstants.MOZ_APP_BUILDID.equals(settings.getString(GeckoPreferences.PREFS_APP_UPDATE_LAST_BUILD_ID, null))) { DistroSharedPrefsImport.importPreferences(distribution.context, distribution); } } catch (IOException e) { Log.e(LOGTAG, "Error getting distribution descriptor file.", e); } Loading Loading @@ -498,6 +512,13 @@ public class Distribution { // We've done the work once; don't do it again. if (this.state == STATE_SET) { // If this is a new version of the app, then copy the // distribution files from the APK if (!AppConstants.MOZ_APP_BUILDID.equals(settings.getString(GeckoPreferences.PREFS_APP_UPDATE_LAST_BUILD_ID, null))) { Log.i(LOGTAG, "Copying APK distribution file because the build ID changed."); copyAndCheckAPKDistribution(); } // Note that we don't compute the distribution directory. // Call `ensureDistributionDir` if you need it. runReadyQueue(); Loading Loading
mobile/android/base/java/org/mozilla/gecko/distribution/Distribution.java +21 −0 Original line number Diff line number Diff line Loading @@ -43,7 +43,9 @@ import org.mozilla.gecko.EventDispatcher; import org.mozilla.gecko.GeckoAppShell; import org.mozilla.gecko.GeckoApplication; import org.mozilla.gecko.GeckoSharedPrefs; import org.mozilla.gecko.preferences.DistroSharedPrefsImport; import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.preferences.GeckoPreferences; import org.mozilla.gecko.util.FileUtils; import org.mozilla.gecko.util.GeckoBundle; import org.mozilla.gecko.util.HardwareUtils; Loading Loading @@ -247,6 +249,18 @@ public class Distribution { data = new GeckoBundle(1); data.putString("preferences", preferencesJSON); // Only overwrite the current preferences if we upgraded. // This isn't the best behavior because if the user // changed one of the preferences, then this overwrites // it. What we really want is a feature where we can // set a new preference if the current value wasn't // user-modified. This implementation doesn't support // something like that. #28842 final SharedPreferences settings = distribution.getSharedPreferences(); if (!AppConstants.MOZ_APP_BUILDID.equals(settings.getString(GeckoPreferences.PREFS_APP_UPDATE_LAST_BUILD_ID, null))) { DistroSharedPrefsImport.importPreferences(distribution.context, distribution); } } catch (IOException e) { Log.e(LOGTAG, "Error getting distribution descriptor file.", e); } Loading Loading @@ -498,6 +512,13 @@ public class Distribution { // We've done the work once; don't do it again. if (this.state == STATE_SET) { // If this is a new version of the app, then copy the // distribution files from the APK if (!AppConstants.MOZ_APP_BUILDID.equals(settings.getString(GeckoPreferences.PREFS_APP_UPDATE_LAST_BUILD_ID, null))) { Log.i(LOGTAG, "Copying APK distribution file because the build ID changed."); copyAndCheckAPKDistribution(); } // Note that we don't compute the distribution directory. // Call `ensureDistributionDir` if you need it. runReadyQueue(); Loading