From ece06b1933c26688d2eb6b7fa8657acbb8833728 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 16 Sep 2015 19:33:43 +0200 Subject: multidecrypt: use bottom sheet for longclick options --- .../keychain/operations/InputDataOperation.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java index 14f711df0..a5208e05b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java @@ -156,7 +156,6 @@ public class InputDataOperation extends BaseOperation { if (mFilename != null) { log.add(LogType.MSG_DATA_MIME_FILENAME, 3, mFilename); } - log.add(LogType.MSG_DATA_MIME_LENGTH, 3, bd.getContentLength()); Uri uri = TemporaryStorageProvider.createFile(mContext, mFilename, bd.getMimeType()); OutputStream out = mContext.getContentResolver().openOutputStream(uri, "w"); @@ -165,12 +164,15 @@ public class InputDataOperation extends BaseOperation { throw new IOException("Error getting file for writing!"); } - int len; + int len, totalLength = 0; while ((len = is.read(buf)) > 0) { + totalLength += len; out.write(buf, 0, len); } - OpenPgpMetadata metadata = new OpenPgpMetadata(mFilename, bd.getMimeType(), 0L, bd.getContentLength()); + log.add(LogType.MSG_DATA_MIME_LENGTH, 3, totalLength); + + OpenPgpMetadata metadata = new OpenPgpMetadata(mFilename, bd.getMimeType(), 0L, totalLength); out.close(); outputUris.add(uri); -- cgit v1.2.3