Skip to content

Commit b607a09

Browse files
authored
Merge pull request #7975 from TacoTheDank/updateCheckerRewrite
Migrate app update checker to AndroidX Work
2 parents af89f05 + b8b97fa commit b607a09

11 files changed

Lines changed: 295 additions & 321 deletions

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ dependencies {
220220
// https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-alpha01
221221
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
222222
implementation 'androidx.webkit:webkit:1.4.0'
223+
implementation 'androidx.work:work-runtime:2.7.1'
223224
implementation 'com.google.android.material:material:1.4.0'
224225

225226
/** Third-party libraries **/

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,6 @@
381381
<service
382382
android:name=".RouterActivity$FetcherService"
383383
android:exported="false" />
384-
<service
385-
android:name=".CheckForNewAppVersion"
386-
android:exported="false" />
387384

388385
<!-- opting out of sending metrics to Google in Android System WebView -->
389386
<meta-data android:name="android.webkit.WebView.MetricsOptOut" android:value="true" />

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

Lines changed: 0 additions & 264 deletions
This file was deleted.

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
package org.schabi.newpipe;
2222

23-
import static org.schabi.newpipe.CheckForNewAppVersion.startNewVersionCheckService;
2423
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
2524

2625
import android.content.BroadcastReceiver;
@@ -174,10 +173,9 @@ protected void onPostCreate(final Bundle savedInstanceState) {
174173
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app);
175174

176175
if (prefs.getBoolean(app.getString(R.string.update_app_key), true)) {
177-
// Start the service which is checking all conditions
176+
// Start the worker which is checking all conditions
178177
// and eventually searching for a new version.
179-
// The service searching for a new NewPipe version must not be started in background.
180-
startNewVersionCheckService();
178+
NewVersionWorker.enqueueNewVersionCheckingWork(app);
181179
}
182180
}
183181

app/src/main/java/org/schabi/newpipe/NewVersionManager.kt

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)