/*package*/ static void cleanUpOrphanedJob(Context context, int jobId) { /* * That's necessary if the database was deleted and jobs (especially the JobScheduler) are still around. * Then if a new job is being scheduled, it's possible that the new job has the ID of the old one. Here * we make sure, that no job is left in the system. */ for (JobApi jobApi : JobApi.values()) { if (jobApi.isSupported(context)) { try { jobApi.getProxy(context).cancel(jobId); } catch (Exception ignored) { // GCM API could crash if it's disabled, ignore crashes at this point and continue } } } }
private boolean cancelInner(@Nullable JobRequest request) { if (request != null) { CAT.i("Found pending job %s, canceling", request); getJobProxy(request.getJobApi()).cancel(request.getJobId()); getJobStorage().remove(request); request.setScheduledAt(0); // reset value return true; } else { return false; } }
/*package*/ static void cleanUpOrphanedJob(Context context, int jobId) { /* * That's necessary if the database was deleted and jobs (especially the JobScheduler) are still around. * Then if a new job is being scheduled, it's possible that the new job has the ID of the old one. Here * we make sure, that no job is left in the system. */ for (JobApi jobApi : JobApi.values()) { if (jobApi.isSupported(context)) { try { jobApi.getProxy(context).cancel(jobId); } catch (Exception ignored) { // GCM API could crash if it's disabled, ignore crashes at this point and continue } } } }
private boolean cancelInner(@Nullable JobRequest request) { if (request != null) { CAT.i("Found pending job %s, canceling", request); getJobProxy(request.getJobApi()).cancel(request.getJobId()); getJobStorage().remove(request); request.setScheduledAt(0); // reset value return true; } else { return false; } }