aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-02-15 15:46:30 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-02-15 15:46:30 +0100
commit3d59796337e99c0153cf173eba617d156f158d3c (patch)
treec35b08632012d0fc654e44933acc8b5d252b4ae0 /OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org
parentf9578d24fad3d96b490fd5a8cf7ce84e8742e69b (diff)
downloadopen-keychain-3d59796337e99c0153cf173eba617d156f158d3c.tar.gz
open-keychain-3d59796337e99c0153cf173eba617d156f158d3c.tar.bz2
open-keychain-3d59796337e99c0153cf173eba617d156f158d3c.zip
Fix problem with unparceling by setting class loader in api lib, remove unneeded aidl classes
Diffstat (limited to 'OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org')
-rw-r--r--OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java
index 5c38d3304..f121c345d 100644
--- a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java
+++ b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java
@@ -16,6 +16,7 @@
package org.openintents.openpgp.util;
+import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
@@ -30,6 +31,7 @@ import java.io.OutputStream;
public class OpenPgpApi {
IOpenPgpService mService;
+ Context mContext;
private static final int OPERATION_SIGN = 0;
private static final int OPERATION_ENCRYPT = 1;
@@ -37,7 +39,8 @@ public class OpenPgpApi {
private static final int OPERATION_DECRYPT_VERIFY = 3;
private static final int OPERATION_GET_KEY_IDS = 4;
- public OpenPgpApi(IOpenPgpService service) {
+ public OpenPgpApi(Context context, IOpenPgpService service) {
+ this.mContext = context;
this.mService = service;
}
@@ -131,7 +134,7 @@ public class OpenPgpApi {
try {
params.putInt(OpenPgpConstants.PARAMS_API_VERSION, OpenPgpConstants.API_VERSION);
- Bundle result = new Bundle();
+ Bundle result = null;
if (operationId == OPERATION_GET_KEY_IDS) {
result = mService.getKeyIds(params);
@@ -174,6 +177,11 @@ public class OpenPgpApi {
// close() is required to halt the TransferThread
output.close();
+ // set class loader to current context to allow unparcelling
+ // of OpenPgpError and OpenPgpSignatureResult
+ // http://stackoverflow.com/a/3806769
+ result.setClassLoader(mContext.getClassLoader());
+
return result;
}
} catch (Exception e) {