Skip to content

Commit 9240268

Browse files
committed
Improve new version checks before running
1 parent 3703fed commit 9240268

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ protected void onCreate(final Bundle savedInstanceState) {
170170
NotificationWorker.initialize(this);
171171
}
172172
if (!UpdateSettingsFragment.wasUserAskedForConsent(this)
173-
&& ReleaseVersionUtil.INSTANCE.isReleaseApk()
174-
&& !App.getApp().isFirstRun()) {
173+
&& !App.getApp().isFirstRun()
174+
&& ReleaseVersionUtil.INSTANCE.isReleaseApk()) {
175175
UpdateSettingsFragment.askForConsentToUpdateChecks(this);
176176
}
177177
}
@@ -183,7 +183,8 @@ protected void onPostCreate(final Bundle savedInstanceState) {
183183
final App app = App.getApp();
184184
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app);
185185

186-
if (prefs.getBoolean(app.getString(R.string.update_app_key), false)) {
186+
if (prefs.getBoolean(app.getString(R.string.update_app_key), false)
187+
&& prefs.getBoolean(app.getString(R.string.update_check_consent_key), false)) {
187188
// Start the worker which is checking all conditions
188189
// and eventually searching for a new version.
189190
NewVersionWorker.enqueueNewVersionCheckingWork(app, false);

0 commit comments

Comments
 (0)