mirror of
https://github.com/samsonjs/media.git
synced 2026-03-30 10:15:48 +00:00
Add a couple of assertions to DownloadManager set methods
PiperOrigin-RevId: 246491511
This commit is contained in:
parent
116602d8c0
commit
71d7e0afe2
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue