本文整理汇总了Java中com.evernote.android.job.JobRequest.isTransient方法的典型用法代码示例。如果您正苦于以下问题:Java JobRequest.isTransient方法的具体用法?Java JobRequest.isTransient怎么用?Java JobRequest.isTransient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.evernote.android.job.JobRequest
的用法示例。
在下文中一共展示了JobRequest.isTransient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isJobInfoScheduled
import com.evernote.android.job.JobRequest; //导入方法依赖的package包/类
@SuppressWarnings("SimplifiableIfStatement")
protected boolean isJobInfoScheduled(@Nullable JobInfo info, @NonNull JobRequest request) {
boolean correctInfo = info != null && info.getId() == request.getJobId();
if (!correctInfo) {
return false;
}
return !request.isTransient() || TransientBundleCompat.isScheduled(mContext, request.getJobId());
}
示例2: setTransientBundle
import com.evernote.android.job.JobRequest; //导入方法依赖的package包/类
protected JobInfo.Builder setTransientBundle(JobRequest request, JobInfo.Builder builder) {
if (request.isTransient()) {
TransientBundleCompat.persistBundle(mContext, request);
}
return builder;
}
示例3: onStartJob
import com.evernote.android.job.JobRequest; //导入方法依赖的package包/类
@Override
public boolean onStartJob(final JobParameters params) {
final int jobId = params.getJobId();
final JobProxy.Common common = new JobProxy.Common(this, CAT, jobId);
// don't mark starting!
final JobRequest request = common.getPendingRequest(true, false);
if (request == null) {
return false;
}
if (request.isTransient()) {
if (TransientBundleCompat.startWithTransientBundle(this, request)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// should only happen during testing if an API is disabled
CAT.d("PendingIntent for transient bundle is not null although running on O, using compat mode, request %s", request);
}
return false;
} else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
CAT.d("PendingIntent for transient job %s expired", request);
return false;
}
}
common.markStarting(request);
JobConfig.getExecutorService().execute(new Runnable() {
@Override
public void run() {
try {
common.executeJobRequest(request, getTransientBundle(params));
} finally {
// do not reschedule
jobFinished(params, false);
}
}
});
// yes, we have a job running in the background
return true;
}