aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Doits <markus.doits@gmail.com>2011-01-23 21:36:44 +0000
committerMarkus Doits <markus.doits@gmail.com>2011-01-23 21:36:44 +0000
commitefc5575d56e4888f8335a76a7a44472aa53965ea (patch)
treed085aa42b7d7afb1d29ae30f77d6675ef08007ea
parent1ec5fc05412c6d7019dd40497a81397752bee602 (diff)
downloadopen-keychain-efc5575d56e4888f8335a76a7a44472aa53965ea.tar.gz
open-keychain-efc5575d56e4888f8335a76a7a44472aa53965ea.tar.bz2
open-keychain-efc5575d56e4888f8335a76a7a44472aa53965ea.zip
Change the way the complete result can be retrieved
-rw-r--r--src/org/thialfihar/android/apg/utils/ApgCon.java32
1 files 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
*
* <p>
- * 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.
* </p>
* <p>
* Note, that when your last remote call is unsuccessful, the result will
@@ -620,12 +616,36 @@ 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
+ *
+ * <p>
+ * 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.
+ * </p>
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @return the complete result-bundle of the last call to apg
+ */
+ public Bundle get_result_bundle() {
+ return result;
+ }
+
+ /**
* Clears all unfetched errors
*
* @see #get_next_error()