From 92402685f81bfc25f37efe4d1d6ff861486c5dd6 Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 29 Mar 2024 11:14:30 +0100 Subject: [PATCH] Improve new version checks before running --- app/src/main/java/org/schabi/newpipe/MainActivity.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 094eb5197..175694125 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -170,8 +170,8 @@ public class MainActivity extends AppCompatActivity { NotificationWorker.initialize(this); } if (!UpdateSettingsFragment.wasUserAskedForConsent(this) - && ReleaseVersionUtil.INSTANCE.isReleaseApk() - && !App.getApp().isFirstRun()) { + && !App.getApp().isFirstRun() + && ReleaseVersionUtil.INSTANCE.isReleaseApk()) { UpdateSettingsFragment.askForConsentToUpdateChecks(this); } } @@ -183,7 +183,8 @@ public class MainActivity extends AppCompatActivity { final App app = App.getApp(); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app); - if (prefs.getBoolean(app.getString(R.string.update_app_key), false)) { + if (prefs.getBoolean(app.getString(R.string.update_app_key), false) + && prefs.getBoolean(app.getString(R.string.update_check_consent_key), false)) { // Start the worker which is checking all conditions // and eventually searching for a new version. NewVersionWorker.enqueueNewVersionCheckingWork(app, false);