1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01:00

Improve new version checks before running

This commit is contained in:
Stypox 2024-03-29 11:14:30 +01:00
parent 3703fed1a5
commit 92402685f8
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -170,8 +170,8 @@ public class MainActivity extends AppCompatActivity {
NotificationWorker.initialize(this); NotificationWorker.initialize(this);
} }
if (!UpdateSettingsFragment.wasUserAskedForConsent(this) if (!UpdateSettingsFragment.wasUserAskedForConsent(this)
&& ReleaseVersionUtil.INSTANCE.isReleaseApk() && !App.getApp().isFirstRun()
&& !App.getApp().isFirstRun()) { && ReleaseVersionUtil.INSTANCE.isReleaseApk()) {
UpdateSettingsFragment.askForConsentToUpdateChecks(this); UpdateSettingsFragment.askForConsentToUpdateChecks(this);
} }
} }
@ -183,7 +183,8 @@ public class MainActivity extends AppCompatActivity {
final App app = App.getApp(); final App app = App.getApp();
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app); 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 // Start the worker which is checking all conditions
// and eventually searching for a new version. // and eventually searching for a new version.
NewVersionWorker.enqueueNewVersionCheckingWork(app, false); NewVersionWorker.enqueueNewVersionCheckingWork(app, false);