aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-09-16 20:44:32 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-09-16 20:45:12 +0200
commit01038d6a2640ce3c6327389798077bb4b35a6c9b (patch)
tree5b924b4d36e33dddf77c23d795a39be785fb3001 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations
parent4722ecb9557ff9659cf5f6319139624bc64a5da5 (diff)
downloadopen-keychain-01038d6a2640ce3c6327389798077bb4b35a6c9b.tar.gz
open-keychain-01038d6a2640ce3c6327389798077bb4b35a6c9b.tar.bz2
open-keychain-01038d6a2640ce3c6327389798077bb4b35a6c9b.zip
mime: add logging messages
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java35
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java2
2 files changed, 18 insertions, 19 deletions
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 0bbbdeb31..99bd0ebef 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/InputDataOperation.java
@@ -75,7 +75,7 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
PgpDecryptVerifyInputParcel decryptInput = input.getDecryptInput();
if (decryptInput != null) {
- log.add(LogType.MSG_DATA_DECRYPT, 1);
+ log.add(LogType.MSG_DATA_OPENPGP, 1);
PgpDecryptVerifyOperation op =
new PgpDecryptVerifyOperation(mContext, mProviderHelper, mProgressable);
@@ -175,7 +175,7 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
out.write(buf, 0, len);
} while ((len = is.read(buf)) > 0);
- log.add(LogType.MSG_DATA_MIME_LENGTH, 3, totalLength);
+ log.add(LogType.MSG_DATA_MIME_LENGTH, 3, Long.toString(totalLength));
String charset = bd.getCharset();
// the charset defaults to us-ascii, but we want to default to utf-8
@@ -199,27 +199,26 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
parser.parse(in);
// if no mime data parsed, just return the raw data as fallback
- if (outputUris.isEmpty()) {
-
- log.add(LogType.MSG_DATA_MIME_NONE, 2);
-
- OpenPgpMetadata metadata;
- if (decryptResult != null) {
- metadata = decryptResult.getDecryptionMetadata();
- } else {
- // if we neither decrypted nor mime-decoded, should this be treated as an error?
- // either way, we know nothing about the data
- metadata = new OpenPgpMetadata();
- }
-
- outputUris.add(currentInputUri);
- metadatas.add(metadata);
+ if (!outputUris.isEmpty()) {
+ log.add(LogType.MSG_DATA_MIME_OK, 2);
log.add(LogType.MSG_DATA_OK, 1);
return new InputDataResult(InputDataResult.RESULT_OK, log, decryptResult, outputUris, metadatas);
}
- log.add(LogType.MSG_DATA_MIME_OK, 2);
+ log.add(LogType.MSG_DATA_MIME_NONE, 2);
+
+ OpenPgpMetadata metadata;
+ if (decryptResult != null) {
+ metadata = decryptResult.getDecryptionMetadata();
+ } else {
+ // if we neither decrypted nor mime-decoded, should this be treated as an error?
+ // either way, we know nothing about the data
+ metadata = new OpenPgpMetadata();
+ }
+
+ outputUris.add(currentInputUri);
+ metadatas.add(metadata);
log.add(LogType.MSG_DATA_OK, 1);
return new InputDataResult(InputDataResult.RESULT_OK, log, decryptResult, outputUris, metadatas);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
index 70ff7b338..6db2539d5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
@@ -827,7 +827,7 @@ public abstract class OperationResult implements Parcelable {
// InputData Operation
MSG_DATA (LogLevel.START, R.string.msg_data),
- MSG_DATA_DECRYPT (LogLevel.DEBUG, R.string.msg_data_decrypt),
+ MSG_DATA_OPENPGP (LogLevel.DEBUG, R.string.msg_data_openpgp),
MSG_DATA_ERROR_IO (LogLevel.ERROR, R.string.msg_data_error_io),
MSG_DATA_MIME_ERROR (LogLevel.ERROR, R.string.msg_data_mime_error),
MSG_DATA_MIME_FILENAME (LogLevel.DEBUG, R.string.msg_data_mime_filename),