googleapis / googleapis/google-api-java-client
Handling Thread.interrupted in MediaHttpDownload
未关闭
priority: p4
type: feature request
- 主要语言
- Java
- 星标
- 1.5k
- 派生
- 772
- 平均合并
- 1 小时 44 分钟
- 30 天内合并 PR
- 1
描述
I was wondering if you could make a change such as the following to handle stopping a download. The developer could interrupt the background Thread doing the download to stop it.
if (mediaContentLength <= nextByteIndex || Thread.interrupted()) {
// All required bytes have been downloaded from the server.
bytesDownloaded = mediaContentLength;
updateStateAndNotifyListener(DownloadState.MEDIA_COMPLETE);
return;
}
贡献指南
评估
这个 Issue 还没有评估数据。