@Test public void setSingleDownloadStopReason_doesNotAffectOtherDownloads() throws Throwable { DownloadRunner runner1 = new DownloadRunner(uri1); DownloadRunner runner2 = new DownloadRunner(uri2); DownloadRunner runner3 = new DownloadRunner(uri3); runner1.postDownloadRequest().getTask().assertDownloading(); runner2.postDownloadRequest().postRemoveRequest().getTask().assertRemoving(); runOnMainThread(() -> downloadManager.setStopReason(runner1.getTask().taskId, APP_STOP_REASON)); runner1.getTask().assertStopped(); runner2.getDownloader(1).unblock().assertReleased(); runner3.postDownloadRequest().getDownloader(0).assertStarted().unblock(); downloadManagerListener.blockUntilTasksCompleteAndThrowAnyDownloadError(); }
public void setStopReason(@Nullable String id, int stopReason) { pendingMessages++; internalHandler .obtainMessage(MSG_SET_STOP_REASON, stopReason, 0, id) .sendToTarget(); }
DownloadManager { public void setStopReason(@Nullable String id, int stopReason) { pendingMessages++; internalHandler .obtainMessage(MSG_SET_STOP_REASON, stopReason, 0, id) .sendToTarget(); } }
DownloadManager { public void setStopReason(@Nullable String id, int stopReason) { pendingMessages++; internalHandler .obtainMessage(MSG_SET_STOP_REASON, stopReason, 0, id) .sendToTarget(); } DownloadManager(
      Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory);  DownloadManager(
      Context context, WritableDownloadIndex downloadIndex, DownloaderFactory downloaderFactory); }
DownloadManager { public void setStopReason(@Nullable String id, int stopReason) { pendingMessages++; internalHandler .obtainMessage(MSG_SET_STOP_REASON, stopReason, 0, id) .sendToTarget(); } DownloadManager(
      Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory);  DownloadManager(
      Context context, WritableDownloadIndex downloadIndex, DownloaderFactory downloaderFactory); boolean isInitialized(); boolean isIdle(); boolean isWaitingForRequirements(); void addListener(Listener listener); void removeListener(Listener listener); Requirements getRequirements(); @Requirements.RequirementFlags int getNotMetRequirements(); void setRequirements(Requirements requirements); int getMaxParallelDownloads(); void setMaxParallelDownloads(int maxParallelDownloads); int getMinRetryCount(); void setMinRetryCount(int minRetryCount); DownloadIndex getDownloadIndex(); List<Download> getCurrentDownloads(); boolean getDownloadsPaused(); void resumeDownloads(); void pauseDownloads(); void setStopReason(@Nullable String id, int stopReason); void addDownload(DownloadRequest request); void addDownload(DownloadRequest request, int stopReason); void removeDownload(String id); void release(); }
DownloadManager { public void setStopReason(@Nullable String id, int stopReason) { pendingMessages++; internalHandler .obtainMessage(MSG_SET_STOP_REASON, stopReason, 0, id) .sendToTarget(); } DownloadManager(
      Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory);  DownloadManager(
      Context context, WritableDownloadIndex downloadIndex, DownloaderFactory downloaderFactory); boolean isInitialized(); boolean isIdle(); boolean isWaitingForRequirements(); void addListener(Listener listener); void removeListener(Listener listener); Requirements getRequirements(); @Requirements.RequirementFlags int getNotMetRequirements(); void setRequirements(Requirements requirements); int getMaxParallelDownloads(); void setMaxParallelDownloads(int maxParallelDownloads); int getMinRetryCount(); void setMinRetryCount(int minRetryCount); DownloadIndex getDownloadIndex(); List<Download> getCurrentDownloads(); boolean getDownloadsPaused(); void resumeDownloads(); void pauseDownloads(); void setStopReason(@Nullable String id, int stopReason); void addDownload(DownloadRequest request); void addDownload(DownloadRequest request, int stopReason); void removeDownload(String id); void release(); static final int DEFAULT_MAX_PARALLEL_DOWNLOADS; static final int DEFAULT_MIN_RETRY_COUNT; static final Requirements DEFAULT_REQUIREMENTS; }