Search in sources :

Example 6 with PreUploadResult

use of org.thoughtcrime.securesms.sms.MessageSender.PreUploadResult in project Signal-Android by signalapp.

the class MediaUploadRepository method cancelUploadInternal.

private void cancelUploadInternal(@NonNull Media media) {
    JobManager jobManager = ApplicationDependencies.getJobManager();
    PreUploadResult result = uploadResults.get(media);
    if (result != null) {
        Stream.of(result.getJobIds()).forEach(jobManager::cancel);
        uploadResults.remove(media);
    }
}
Also used : JobManager(org.thoughtcrime.securesms.jobmanager.JobManager) PreUploadResult(org.thoughtcrime.securesms.sms.MessageSender.PreUploadResult)

Aggregations

PreUploadResult (org.thoughtcrime.securesms.sms.MessageSender.PreUploadResult)6 WorkerThread (androidx.annotation.WorkerThread)4 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Attachment (org.thoughtcrime.securesms.attachments.Attachment)2 AttachmentId (org.thoughtcrime.securesms.attachments.AttachmentId)2 JobManager (org.thoughtcrime.securesms.jobmanager.JobManager)2