mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 19:57:43 +00:00
Do not check update twice
This commit is contained in:
parent
bb7560e441
commit
70eba568af
@ -28,7 +28,7 @@ public class SplashActivity extends BaseActivity {
|
||||
String pkg = Config.get(Config.Key.SU_MANAGER);
|
||||
if (pkg != null && getPackageName().equals(BuildConfig.APPLICATION_ID)) {
|
||||
Config.remove(Config.Key.SU_MANAGER);
|
||||
Shell.su("pm uninstall " + pkg).exec();
|
||||
Shell.su("pm uninstall " + pkg).submit();
|
||||
}
|
||||
if (TextUtils.equals(pkg, getPackageName())) {
|
||||
try {
|
||||
@ -57,8 +57,6 @@ public class SplashActivity extends BaseActivity {
|
||||
Shortcuts.setup(this);
|
||||
|
||||
if (Networking.checkNetworkStatus(this)) {
|
||||
// Fire update check
|
||||
CheckUpdates.check();
|
||||
// Repo update check
|
||||
new UpdateRepos().exec();
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.UpdateCheckService;
|
||||
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -30,10 +31,12 @@ public class AppUtils {
|
||||
.Builder(ClassMap.get(UpdateCheckService.class), 12, TimeUnit.HOURS)
|
||||
.setConstraints(constraints)
|
||||
.build();
|
||||
WorkManager.getInstance().enqueueUniquePeriodicWork(Const.ID.CHECK_MAGISK_UPDATE_WORKER_ID,
|
||||
WorkManager.getInstance().enqueueUniquePeriodicWork(
|
||||
Const.ID.CHECK_MAGISK_UPDATE_WORKER_ID,
|
||||
ExistingPeriodicWorkPolicy.REPLACE, request);
|
||||
} else {
|
||||
WorkManager.getInstance().cancelUniqueWork(Const.ID.CHECK_MAGISK_UPDATE_WORKER_ID);
|
||||
CheckUpdates.check();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user