mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Prevent crash
This commit is contained in:
parent
0cfc56638f
commit
3e77686d95
2 changed files with 24 additions and 0 deletions
23
app/src/main/java/eu/faircode/email/JobDaily.java
Normal file
23
app/src/main/java/eu/faircode/email/JobDaily.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package eu.faircode.email;
|
||||
|
||||
import android.app.job.JobParameters;
|
||||
import android.app.job.JobScheduler;
|
||||
import android.app.job.JobService;
|
||||
import android.content.Context;
|
||||
|
||||
public class JobDaily extends JobService {
|
||||
@Override
|
||||
public boolean onStartJob(JobParameters params) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStopJob(JobParameters params) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void cancel(Context context) {
|
||||
JobScheduler scheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
|
||||
scheduler.cancel(1001);
|
||||
}
|
||||
}
|
|
@ -135,6 +135,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
});
|
||||
|
||||
WorkerCleanup.queue();
|
||||
JobDaily.cancel(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue