mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-29 13:30:47 +00:00
Add some javadoc for ProgressListener changes.
// FREEBIE
This commit is contained in:
parent
e7f1c52eb2
commit
c36d13057c
@ -90,6 +90,25 @@ public class TextSecureMessageReceiver {
|
||||
* @throws IOException
|
||||
* @throws InvalidMessageException
|
||||
*/
|
||||
public InputStream retrieveAttachment(TextSecureAttachmentPointer pointer, File destination)
|
||||
throws IOException, InvalidMessageException
|
||||
{
|
||||
return retrieveAttachment(pointer, destination, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a TextSecure attachment.
|
||||
*
|
||||
* @param pointer The {@link org.whispersystems.textsecure.api.messages.TextSecureAttachmentPointer}
|
||||
* received in a {@link TextSecureDataMessage}.
|
||||
* @param destination The download destination for this attachment.
|
||||
* @param listener An optional listener (may be null) to receive callbacks on download progress.
|
||||
*
|
||||
* @return An InputStream that streams the plaintext attachment contents.
|
||||
* @throws IOException
|
||||
* @throws InvalidMessageException
|
||||
*/
|
||||
public InputStream retrieveAttachment(TextSecureAttachmentPointer pointer, File destination, ProgressListener listener)
|
||||
throws IOException, InvalidMessageException
|
||||
{
|
||||
|
@ -83,7 +83,17 @@ public abstract class TextSecureAttachment {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface to receive progress information on upload/download of
|
||||
* an attachment.
|
||||
*/
|
||||
public interface ProgressListener {
|
||||
/**
|
||||
* Called on a progress change event.
|
||||
*
|
||||
* @param total The total amount to transmit/receive in bytes.
|
||||
* @param progress The amount that has been transmitted/received in bytes thus far
|
||||
*/
|
||||
public void onAttachmentProgress(long total, long progress);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user