5353/**
5454 * Facade class providing methods to ease requesting commands to transfer services {@link FileUploader} and
5555 * {@link FileDownloader}.
56- *
56+ * <p>
5757 * Protects client objects from the verbosity of {@link android.content.Intent}s.
58- *
58+ * <p>
5959 * TODO add methods for {@link FileDownloader}, right now it's just about uploads
6060 */
6161
@@ -171,13 +171,13 @@ public void retry(Context context, OCUpload upload, boolean requestedFromWifiBac
171171 /**
172172 * Retry a subset of all the stored failed uploads.
173173 *
174- * @param context Caller {@link Context}
175- * @param account If not null, only failed uploads to this OC account will be retried; otherwise,
176- * uploads of all accounts will be retried.
177- * @param uploadResult If not null, only failed uploads with the result specified will be retried;
178- * otherwise, failed uploads due to any result will be retried.
179- * @param requestedFromWifiBackEvent true if the retry was requested because wifi connection was back,
180- * false otherwise
174+ * @param context Caller {@link Context}
175+ * @param account If not null, only failed uploads to this OC account will be retried; otherwise,
176+ * uploads of all accounts will be retried.
177+ * @param uploadResult If not null, only failed uploads with the result specified will be retried;
178+ * otherwise, failed uploads due to any result will be retried.
179+ * @param requestedFromWifiBackEvent true if the retry was requested because wifi connection was back,
180+ * false otherwise
181181 */
182182 public void retryFailedUploads (Context context , Account account , UploadResult uploadResult ,
183183 boolean requestedFromWifiBackEvent ) {
@@ -201,9 +201,9 @@ public void retryFailedUploads(Context context, Account account, UploadResult up
201201 /**
202202 * Private implementation of retry.
203203 *
204- * @param context Caller {@link Context}
205- * @param account OC account where the upload will be retried.
206- * @param upload Persisted upload to retry.
204+ * @param context Caller {@link Context}
205+ * @param account OC account where the upload will be retried.
206+ * @param upload Persisted upload to retry.
207207 * @param requestedFromWifiBackEvent true if the retry was requested because wifi connection was back,
208208 * false otherwise
209209 */
@@ -235,8 +235,8 @@ private void retry(Context context, Account account, OCUpload upload, boolean re
235235 /**
236236 * Return 'true' when conditions for a scheduled retry are met.
237237 *
238- * @param context Caller {@link Context}
239- * @return 'true' when conditions for a scheduled retry are met, 'false' otherwise.
238+ * @param context Caller {@link Context}
239+ * @return 'true' when conditions for a scheduled retry are met, 'false' otherwise.
240240 */
241241 boolean shouldScheduleRetry (Context context , Exception exception ) {
242242 return (
@@ -251,10 +251,10 @@ boolean shouldScheduleRetry(Context context, Exception exception) {
251251 * Schedule a future retry of an upload, to be done when a connection via an unmetered network (free Wifi)
252252 * is available.
253253 *
254- * @param context Caller {@link Context}.
255- * @param jobId Identifier to set to the retry job.
256- * @param accountName Local name of the OC account where the upload will be retried.
257- * @param remotePath Full path of the file to upload, relative to root of the OC account.
254+ * @param context Caller {@link Context}.
255+ * @param jobId Identifier to set to the retry job.
256+ * @param accountName Local name of the OC account where the upload will be retried.
257+ * @param remotePath Full path of the file to upload, relative to root of the OC account.
258258 */
259259 void scheduleUpload (Context context , int jobId , String accountName , String remotePath ) {
260260 boolean scheduled = scheduleTransfer (
@@ -281,10 +281,10 @@ void scheduleUpload(Context context, int jobId, String accountName, String remot
281281 * Schedule a future retry of a download, to be done when a connection via an unmetered network (free Wifi)
282282 * is available.
283283 *
284- * @param context Caller {@link Context}.
285- * @param jobId Identifier to set to the retry job.
286- * @param accountName Local name of the OC account where the download will be retried.
287- * @param remotePath Full path of the file to download, relative to root of the OC account.
284+ * @param context Caller {@link Context}.
285+ * @param jobId Identifier to set to the retry job.
286+ * @param accountName Local name of the OC account where the download will be retried.
287+ * @param remotePath Full path of the file to download, relative to root of the OC account.
288288 */
289289 void scheduleDownload (Context context , int jobId , String accountName , String remotePath ) {
290290 boolean scheduled = scheduleTransfer (
@@ -311,12 +311,12 @@ void scheduleDownload(Context context, int jobId, String accountName, String rem
311311 * Schedule a future transfer of an upload, to be done when a connection via an unmetered network (free Wifi)
312312 * is available.
313313 *
314- * @param context Caller {@link Context}.
315- * @param scheduledRetryService Class of the appropriate retry service, either to retry downloads
316- * or to retry uploads.
317- * @param jobId Identifier to set to the retry job.
318- * @param accountName Local name of the OC account where the upload will be retried.
319- * @param remotePath Full path of the file to upload, relative to root of the OC account.
314+ * @param context Caller {@link Context}.
315+ * @param scheduledRetryService Class of the appropriate retry service, either to retry downloads
316+ * or to retry uploads.
317+ * @param jobId Identifier to set to the retry job.
318+ * @param accountName Local name of the OC account where the upload will be retried.
319+ * @param remotePath Full path of the file to upload, relative to root of the OC account.
320320 */
321321 private boolean scheduleTransfer (
322322 Context context ,
@@ -325,12 +325,6 @@ private boolean scheduleTransfer(
325325 String accountName ,
326326 String remotePath
327327 ) {
328-
329- // JobShceduler requires Android >= 5.0 ; do not remove this protection while minSdkVersion is lower
330- if (Build .VERSION .SDK_INT < Build .VERSION_CODES .LOLLIPOP ) {
331- return false ;
332- }
333-
334328 ComponentName serviceComponent = new ComponentName (
335329 context ,
336330 scheduledRetryService
@@ -361,9 +355,10 @@ private boolean scheduleTransfer(
361355
362356 /**
363357 * Retrieve the type of network connection required to schedule the last upload for an account
358+ *
364359 * @param context
365360 * @param accountName
366- * @param remotePath to upload the file
361+ * @param remotePath to upload the file
367362 * @return 2 if only wifi is required, 1 if any internet connection is required (wifi or cellular)
368363 */
369364 private int getRequiredNetworkType (Context context , String accountName , String remotePath ) {
0 commit comments