mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-07-03 14:08:39 +02:00
Separate backend logic from frontend UI
This commit is contained in:
@@ -3,7 +3,10 @@ package com.topjohnwu.magisk.services;
|
||||
import android.app.job.JobParameters;
|
||||
import android.app.job.JobService;
|
||||
|
||||
import com.topjohnwu.magisk.asyncs.CheckUpdates;
|
||||
import com.topjohnwu.core.Data;
|
||||
import com.topjohnwu.core.tasks.CheckUpdates;
|
||||
import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.components.Notifications;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class UpdateCheckService extends JobService {
|
||||
@@ -11,7 +14,14 @@ public class UpdateCheckService extends JobService {
|
||||
@Override
|
||||
public boolean onStartJob(JobParameters params) {
|
||||
Shell.getShell();
|
||||
CheckUpdates.check(() -> jobFinished(params, false));
|
||||
CheckUpdates.check(() -> {
|
||||
if (BuildConfig.VERSION_CODE < Data.remoteManagerVersionCode) {
|
||||
Notifications.managerUpdate();
|
||||
} else if (Data.magiskVersionCode < Data.remoteMagiskVersionCode) {
|
||||
Notifications.magiskUpdate();
|
||||
}
|
||||
jobFinished(params, false);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user