Commit 1292a35e by olly Committed by Oliver Woodman

Add a couple of assertions to DownloadManager set methods

PiperOrigin-RevId: 246491511
parent 76184deb
......@@ -306,9 +306,10 @@ public final class DownloadManager {
/**
* Sets the maximum number of parallel downloads.
*
* @param maxParallelDownloads The maximum number of parallel downloads.
* @param maxParallelDownloads The maximum number of parallel downloads. Must be greater than 0.
*/
public void setMaxParallelDownloads(int maxParallelDownloads) {
Assertions.checkArgument(maxParallelDownloads > 0);
if (this.maxParallelDownloads == maxParallelDownloads) {
return;
}
......@@ -334,6 +335,7 @@ public final class DownloadManager {
* @param minRetryCount The minimum number of times that a download will be retried.
*/
public void setMinRetryCount(int minRetryCount) {
Assertions.checkArgument(minRetryCount >= 0);
if (this.minRetryCount == minRetryCount) {
return;
}
......
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