This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onReceive(Context context, Intent intent) { | |
Timber.d("In 15 min alarm check"); | |
JobScheduler scheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); | |
boolean isMyJobScheduled(); | |
List<JobInfo> jobs = scheduler.getAllPendingJobs(); | |
for (JobInfo jobInfo : jobs) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onStartJob(JobParameters jobParameters) { | |
Timber.d("In 15 min job check"); | |
//Check if the alarm is scheduled | |
boolean alarmOn = (PendingIntent.getBroadcast(context, REQUEST_CODE, intent, PendingIntent.FLAG_NO_CREATE)) != null); | |
if(!alarmOn) | |
AlarmScheduler.rescheduleRequiredAlarm(); |