Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
f1872135
Commit
f1872135
authored
Apr 08, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run update check service only in background
parent
fc0df84e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
SplashActivity.java
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
+2
-0
UpdateCheckService.java
...a/com/topjohnwu/magisk/components/UpdateCheckService.java
+5
-2
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+0
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
View file @
f1872135
...
@@ -9,6 +9,7 @@ import androidx.appcompat.app.AlertDialog;
...
@@ -9,6 +9,7 @@ import androidx.appcompat.app.AlertDialog;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.database.RepoDatabaseHelper
;
import
com.topjohnwu.magisk.database.RepoDatabaseHelper
;
import
com.topjohnwu.magisk.tasks.CheckUpdates
;
import
com.topjohnwu.magisk.tasks.UpdateRepos
;
import
com.topjohnwu.magisk.tasks.UpdateRepos
;
import
com.topjohnwu.magisk.uicomponents.Notifications
;
import
com.topjohnwu.magisk.uicomponents.Notifications
;
import
com.topjohnwu.magisk.uicomponents.Shortcuts
;
import
com.topjohnwu.magisk.uicomponents.Shortcuts
;
...
@@ -63,6 +64,7 @@ public class SplashActivity extends BaseActivity {
...
@@ -63,6 +64,7 @@ public class SplashActivity extends BaseActivity {
// Schedule periodic update checks
// Schedule periodic update checks
Utils
.
scheduleUpdateCheck
();
Utils
.
scheduleUpdateCheck
();
CheckUpdates
.
check
();
// Setup shortcuts
// Setup shortcuts
Shortcuts
.
setup
(
this
);
Shortcuts
.
setup
(
this
);
...
...
app/src/main/java/com/topjohnwu/magisk/components/UpdateCheckService.java
View file @
f1872135
...
@@ -3,6 +3,7 @@ package com.topjohnwu.magisk.components;
...
@@ -3,6 +3,7 @@ package com.topjohnwu.magisk.components;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.work.ListenableWorker
;
import
androidx.work.ListenableWorker
;
import
com.topjohnwu.magisk.App
;
import
com.topjohnwu.magisk.BuildConfig
;
import
com.topjohnwu.magisk.BuildConfig
;
import
com.topjohnwu.magisk.Config
;
import
com.topjohnwu.magisk.Config
;
import
com.topjohnwu.magisk.tasks.CheckUpdates
;
import
com.topjohnwu.magisk.tasks.CheckUpdates
;
...
@@ -14,8 +15,10 @@ public class UpdateCheckService extends DelegateWorker {
...
@@ -14,8 +15,10 @@ public class UpdateCheckService extends DelegateWorker {
@NonNull
@NonNull
@Override
@Override
public
ListenableWorker
.
Result
doWork
()
{
public
ListenableWorker
.
Result
doWork
()
{
Shell
.
getShell
();
if
(
App
.
self
.
foreground
==
null
)
{
CheckUpdates
.
check
(
this
::
onCheckDone
);
Shell
.
getShell
();
CheckUpdates
.
check
(
this
::
onCheckDone
);
}
return
ListenableWorker
.
Result
.
success
();
return
ListenableWorker
.
Result
.
success
();
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
f1872135
...
@@ -158,7 +158,6 @@ public class Utils {
...
@@ -158,7 +158,6 @@ public class Utils {
ExistingPeriodicWorkPolicy
.
REPLACE
,
request
);
ExistingPeriodicWorkPolicy
.
REPLACE
,
request
);
}
else
{
}
else
{
WorkManager
.
getInstance
().
cancelUniqueWork
(
Const
.
ID
.
CHECK_MAGISK_UPDATE_WORKER_ID
);
WorkManager
.
getInstance
().
cancelUniqueWork
(
Const
.
ID
.
CHECK_MAGISK_UPDATE_WORKER_ID
);
CheckUpdates
.
check
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment