package com.novoda.downloadmanager;

import android.content.Context;
import android.util.Log;

import com.evernote.android.job.JobManager;
import com.evernote.android.job.JobRequest;

import java.util.concurrent.TimeUnit;

class LiteDownloadsNetworkRecoveryEnabled implements DownloadsNetworkRecovery {

    private final ConnectionType connectionType;

    LiteDownloadsNetworkRecoveryEnabled(Context context, DownloadManager downloadManager, ConnectionType connectionType) {
        this.connectionType = connectionType;
        JobManager jobManager = JobManager.create(context);
        jobManager.addJobCreator(new LiteJobCreator(downloadManager));
    }

    @Override
    public void scheduleRecovery() {
        JobRequest.Builder builder = new JobRequest.Builder(LiteJobCreator.TAG)
                .setExecutionWindow(TimeUnit.SECONDS.toMillis(1), TimeUnit.DAYS.toMillis(1));

        switch (connectionType) {
            case ALL:
                builder.setRequiredNetworkType(JobRequest.NetworkType.CONNECTED);
                break;
            case UNMETERED:
                builder.setRequiredNetworkType(JobRequest.NetworkType.UNMETERED);
                break;
            case METERED:
                builder.setRequiredNetworkType(JobRequest.NetworkType.METERED);
                break;
            default:
                Log.w(getClass().getSimpleName(), "Unknown ConnectionType: " + connectionType);
                break;
        }

        JobRequest jobRequest = builder.build();
        JobManager jobManager = JobManager.instance();

        jobManager.schedule(jobRequest);
    }
}

@@ -65,33 +65,8 @@
 ext;
-%0Aimport android.util.Log;
 %0A%0Aim
@@ -150,16 +150,60 @@
 Request;
+%0Aimport com.novoda.notils.logger.simple.Log;
 %0A%0Aimport
@@ -1369,36 +1369,8 @@
 g.w(
-getClass().getSimpleName(), 
 %22Unk
@@ -1587,20 +1587,67 @@
 obRequest);%0A
+        Log.v(%22Scheduling Network Recovery.%22);%0A
     %7D%0A%7D%0A

Add some logs to scheduling.