Upgrade preferences before using them (#6546)

This commit is contained in:
ByteHamster 2023-07-16 22:22:25 +02:00 committed by GitHub
parent 019e3574c4
commit 196ff13442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 4 deletions

View File

@ -17,6 +17,7 @@ import de.danoeh.antennapod.core.ClientConfig;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.error.CrashReportWriter;
import de.danoeh.antennapod.error.RxJavaErrorHandlerSetup;
import de.danoeh.antennapod.preferences.PreferenceUpgrader;
import de.danoeh.antennapod.spa.SPAUtil;
import org.greenrobot.eventbus.EventBus;
@ -52,6 +53,7 @@ public class PodcastApp extends Application {
singleton = this;
ClientConfigurator.initialize(this);
PreferenceUpgrader.checkUpgrades(this);
Iconify.with(new FontAwesomeModule());
Iconify.with(new MaterialModule());

View File

@ -58,7 +58,6 @@ import de.danoeh.antennapod.fragment.TransitionEffect;
import de.danoeh.antennapod.model.download.DownloadStatus;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterface;
import de.danoeh.antennapod.playback.cast.CastEnabledActivity;
import de.danoeh.antennapod.preferences.PreferenceUpgrader;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter;
import de.danoeh.antennapod.ui.common.ThemeUtils;
@ -160,7 +159,6 @@ public class MainActivity extends CastEnabledActivity {
transaction.commit();
checkFirstLaunch();
PreferenceUpgrader.checkUpgrades(this);
View bottomSheet = findViewById(R.id.audioplayerFragment);
sheetBehavior = (LockableBottomSheetBehavior) BottomSheetBehavior.from(bottomSheet);
sheetBehavior.setHideable(false);

View File

@ -13,7 +13,6 @@ import de.danoeh.antennapod.core.preferences.SleepTimerPreferences;
import de.danoeh.antennapod.error.CrashReportWriter;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.storage.preferences.UserPreferences.EnqueueLocation;
import de.danoeh.antennapod.core.util.download.FeedUpdateManager;
import de.danoeh.antennapod.fragment.QueueFragment;
import de.danoeh.antennapod.fragment.swipeactions.SwipeAction;
import de.danoeh.antennapod.fragment.swipeactions.SwipeActions;
@ -31,7 +30,6 @@ public class PreferenceUpgrader {
int newVersion = BuildConfig.VERSION_CODE;
if (oldVersion != newVersion) {
FeedUpdateManager.restartUpdateAlarm(context, true);
CrashReportWriter.getFile().delete();
upgrade(oldVersion, context);