@Test public void setSingleDownloadStopReasonThenRemove_removesDownload() throws Throwable { DownloadRunner runner = new DownloadRunner(uri1).postDownloadRequest(); TaskWrapper task = runner.getTask(); task.assertDownloading(); runOnMainThread(() -> downloadManager.setStopReason(task.taskId, APP_STOP_REASON)); task.assertStopped(); runner.postRemoveRequest(); runner.getDownloader(1).assertStarted().unblock(); task.assertRemoved(); 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; }