/** * @return If {@code true}, then the job should only run if the battery isn't low. */ public boolean requiresStorageNotLow() { return mRequest.requiresStorageNotLow(); }
/** * @return Whether the storage not low requirement is met. That's true either if it's not a requirement * or if the storage actually isn't low. */ protected boolean isRequirementStorageNotLowMet() { return !(getParams().getRequest().requiresStorageNotLow() && Device.isStorageLow()); }
/** * @return Whether any of the requirements is different than the default value. */ public boolean hasRequirements() { return requiresCharging() || requiresDeviceIdle() || requiresBatteryNotLow() || requiresStorageNotLow() || requiredNetworkType() != DEFAULT_NETWORK_TYPE; }
@Override protected JobInfo.Builder createBaseBuilder(JobRequest request, boolean allowPersisting) { return super.createBaseBuilder(request, allowPersisting) .setRequiresBatteryNotLow(request.requiresBatteryNotLow()) .setRequiresStorageNotLow(request.requiresStorageNotLow()); }
private static Constraints buildConstraints(JobRequest request) { Constraints.Builder constraintsBuilder = new Constraints.Builder() .setRequiresBatteryNotLow(request.requiresBatteryNotLow()) .setRequiresCharging(request.requiresCharging()) .setRequiresStorageNotLow(request.requiresStorageNotLow()) .setRequiredNetworkType(mapNetworkType(request.requiredNetworkType())); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { constraintsBuilder.setRequiresDeviceIdle(request.requiresDeviceIdle()); } return constraintsBuilder.build(); }
/** * @return If {@code true}, then the job should only run if the battery isn't low. */ public boolean requiresStorageNotLow() { return mRequest.requiresStorageNotLow(); }
/** * @return Whether the storage not low requirement is met. That's true either if it's not a requirement * or if the storage actually isn't low. */ protected boolean isRequirementStorageNotLowMet() { return !(getParams().getRequest().requiresStorageNotLow() && Device.isStorageLow()); }
@Override protected JobInfo.Builder createBaseBuilder(JobRequest request, boolean allowPersisting) { return super.createBaseBuilder(request, allowPersisting) .setRequiresBatteryNotLow(request.requiresBatteryNotLow()) .setRequiresStorageNotLow(request.requiresStorageNotLow()); }
/** * @return Whether any of the requirements is different than the default value. */ public boolean hasRequirements() { return requiresCharging() || requiresDeviceIdle() || requiresBatteryNotLow() || requiresStorageNotLow() || requiredNetworkType() != DEFAULT_NETWORK_TYPE; }