Don't show notification again if coming from notification

This commit is contained in:
topjohnwu
2017-02-17 09:26:17 +08:00
parent ac44f05811
commit 1d70d0fe94
3 changed files with 12 additions and 12 deletions

View File

@@ -39,14 +39,16 @@ public class SplashActivity extends Activity{
boolean started = Utils.isValidShellResponse(ret) && Integer.parseInt(ret.get(0)) != 0;
// Initialize the update check service, notify every 3 hours
ComponentName service = new ComponentName(magiskManager, UpdateCheckService.class);
JobInfo jobInfo = new JobInfo.Builder(UPDATE_SERVICE_ID, service)
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
.setPersisted(true)
.setPeriodic(3 * 60 * 60 * 1000)
.build();
JobScheduler scheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
scheduler.schedule(jobInfo);
if (!"install".equals(getIntent().getStringExtra(MainActivity.SECTION))) {
ComponentName service = new ComponentName(magiskManager, UpdateCheckService.class);
JobInfo jobInfo = new JobInfo.Builder(UPDATE_SERVICE_ID, service)
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
.setPersisted(true)
.setPeriodic(3 * 60 * 60 * 1000)
.build();
JobScheduler scheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
scheduler.schedule(jobInfo);
}
// Now fire all async tasks
new GetBootBlocks(this).exec();
@@ -62,7 +64,7 @@ public class SplashActivity extends Activity{
}
}.exec();
new LoadApps(this).exec();
new CheckUpdates(this, true){
new CheckUpdates(this, !"install".equals(getIntent().getStringExtra(MainActivity.SECTION))){
@Override
protected void onPostExecute(Void v) {
super.onPostExecute(v);