Commit c1372299 by andrewlewis Committed by Oliver Woodman

Misc nit fixes for downloader

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195358542
parent e6973226
......@@ -464,13 +464,13 @@ public final class DownloadManager {
});
}
private void logd(String message) {
private static void logd(String message) {
if (DEBUG) {
Log.d(TAG, message);
}
}
private void logd(String message, Task task) {
private static void logd(String message, Task task) {
logd(message + ": " + task);
}
......@@ -710,7 +710,7 @@ public final class DownloadManager {
private void stop() {
if (changeStateAndNotify(STATE_STARTED, STATE_STARTED_STOPPING)) {
downloadManager.logd("Stopping", this);
logd("Stopping", this);
thread.interrupt();
}
}
......@@ -737,7 +737,7 @@ public final class DownloadManager {
@Override
public void run() {
downloadManager.logd("Task is started", this);
logd("Task is started", this);
Throwable error = null;
try {
downloader = action.createDownloader(downloadManager.downloaderConstructorHelper);
......@@ -753,15 +753,14 @@ public final class DownloadManager {
} catch (IOException e) {
long downloadedBytes = downloader.getDownloadedBytes();
if (downloadedBytes != errorPosition) {
downloadManager.logd(
"Reset error count. downloadedBytes = " + downloadedBytes, this);
logd("Reset error count. downloadedBytes = " + downloadedBytes, this);
errorPosition = downloadedBytes;
errorCount = 0;
}
if (currentState != STATE_STARTED || ++errorCount > minRetryCount) {
throw e;
}
downloadManager.logd("Download error. Retry " + errorCount, this);
logd("Download error. Retry " + errorCount, this);
Thread.sleep(getRetryDelayMillis(errorCount));
}
}
......
......@@ -42,7 +42,7 @@ public final class ProgressiveDownloader implements Downloader {
* @param uri Uri of the data to be downloaded.
* @param customCacheKey A custom key that uniquely identifies the original stream. Used for cache
* indexing. May be null.
* @param constructorHelper a {@link DownloaderConstructorHelper} instance.
* @param constructorHelper A {@link DownloaderConstructorHelper} instance.
*/
public ProgressiveDownloader(
Uri uri, String customCacheKey, DownloaderConstructorHelper constructorHelper) {
......
......@@ -75,7 +75,7 @@ public abstract class SegmentDownloader<M extends FilterableManifest<M, K>, K>
/**
* @param manifestUri The {@link Uri} of the manifest to be downloaded.
* @param constructorHelper a {@link DownloaderConstructorHelper} instance.
* @param constructorHelper A {@link DownloaderConstructorHelper} instance.
* @param trackKeys Track keys to select when downloading. If empty, all tracks are downloaded.
*/
public SegmentDownloader(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment