googleapis / googleapis/google-api-java-client

Handling Thread.interrupted in MediaHttpDownload

Ouverte
#1,051 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
priority: p4 type: feature request
Langage dominant
Java
Étoiles
1.5k
Forks
772
Merge moyen
1 h 44 min
PR mergées (30 j)
1

Description

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;
}

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.