use of org.openintents.openpgp.util.OpenPgpApi.IOpenPgpSinkResultCallback in project k-9 by k9mail.
the class MessageCryptoHelper method callAsyncInlineOperation.
private void callAsyncInlineOperation(Intent intent) throws IOException {
OpenPgpDataSource dataSource = getDataSourceForEncryptedOrInlineData();
OpenPgpDataSink<MimeBodyPart> dataSink = getDataSinkForDecryptedInlineData();
cancelableBackgroundOperation = openPgpApi.executeApiAsync(intent, dataSource, dataSink, new IOpenPgpSinkResultCallback<MimeBodyPart>() {
@Override
public void onProgress(int current, int max) {
Timber.d("received progress status: %d / %d", current, max);
callbackProgress(current, max);
}
@Override
public void onReturn(Intent result, MimeBodyPart bodyPart) {
cancelableBackgroundOperation = null;
currentCryptoResult = result;
onCryptoOperationReturned(bodyPart);
}
});
}
use of org.openintents.openpgp.util.OpenPgpApi.IOpenPgpSinkResultCallback in project k-9 by k9mail.
the class MessageCryptoHelper method callAsyncDecrypt.
private void callAsyncDecrypt(Intent intent) throws IOException {
OpenPgpDataSource dataSource = getDataSourceForEncryptedOrInlineData();
OpenPgpDataSink<MimeBodyPart> openPgpDataSink = getDataSinkForDecryptedData();
cancelableBackgroundOperation = openPgpApi.executeApiAsync(intent, dataSource, openPgpDataSink, new IOpenPgpSinkResultCallback<MimeBodyPart>() {
@Override
public void onReturn(Intent result, MimeBodyPart decryptedPart) {
cancelableBackgroundOperation = null;
currentCryptoResult = result;
onCryptoOperationReturned(decryptedPart);
}
@Override
public void onProgress(int current, int max) {
Timber.d("received progress status: %d / %d", current, max);
callbackProgress(current, max);
}
});
}
Aggregations