From efc5575d56e4888f8335a76a7a44472aa53965ea Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Sun, 23 Jan 2011 21:36:44 +0000 Subject: [PATCH] Change the way the complete result can be retrieved --- .../thialfihar/android/apg/utils/ApgCon.java | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/org/thialfihar/android/apg/utils/ApgCon.java b/src/org/thialfihar/android/apg/utils/ApgCon.java index 225320108..9a0ccb44b 100644 --- a/src/org/thialfihar/android/apg/utils/ApgCon.java +++ b/src/org/thialfihar/android/apg/utils/ApgCon.java @@ -327,10 +327,6 @@ public class ApgCon { new call_async().execute(function); } - public boolean call(String function, Bundle pReturn) { - return call(function, args, pReturn); - } - private boolean call(String function, Bundle pArgs, Bundle pReturn) { if (!initialize()) { @@ -603,8 +599,8 @@ public class ApgCon { * Get the result * *

- * This gets your result. After doing anything with APG, you get the output - * with this function + * This gets your result. After doing an encryption or decryption with APG, + * you get the output with this function. *

*

* Note, that when your last remote call is unsuccessful, the result will @@ -620,11 +616,35 @@ public class ApgCon { * * @see #reset() * @see #clear_result() + * @see #get_result_bundle() */ public String get_result() { return result.getString(ret.RESULT.name()); } + /** + * Get the result bundle + * + *

+ * Unlike {@link #get_result()}, which only returns any en-/decrypted + * message, this function returns the complete information that was returned + * by Apg. This also includes the "RESULT", but additionally the warnings, + * errors and any other information. + *

+ *

+ * For warnings and errors it is suggested to use the functions that are + * provided here, namely {@link #get_error()}, {@link #get_next_error()}, + * {@link #get_next_Warning()} etc.), but if any call returns something non + * standard, you have access to the complete result bundle to extract the + * information. + *

+ * + * @return the complete result-bundle of the last call to apg + */ + public Bundle get_result_bundle() { + return result; + } + /** * Clears all unfetched errors *