Skip to content

Commit

Permalink
Improve new version checks before running
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Mar 29, 2024
1 parent 3703fed commit 9240268
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/org/schabi/newpipe/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ protected void onCreate(final Bundle savedInstanceState) {
NotificationWorker.initialize(this);
}
if (!UpdateSettingsFragment.wasUserAskedForConsent(this)
&& ReleaseVersionUtil.INSTANCE.isReleaseApk()
&& !App.getApp().isFirstRun()) {
&& !App.getApp().isFirstRun()
&& ReleaseVersionUtil.INSTANCE.isReleaseApk()) {
UpdateSettingsFragment.askForConsentToUpdateChecks(this);
}
}
Expand All @@ -183,7 +183,8 @@ protected void onPostCreate(final Bundle savedInstanceState) {
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);
Expand Down

0 comments on commit 9240268

Please sign in to comment.