aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2016-02-23 16:29:41 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2016-02-24 11:31:32 +0100
commit31b27e59ee8f578be35df1e4ece3c4381c5dfae5 (patch)
tree4a3aa4b5862ea29289ad5a7f367f82628731054c
parent1c256e9e50547f92f7e468fadd442157155d57c8 (diff)
downloadopen-keychain-31b27e59ee8f578be35df1e4ece3c4381c5dfae5.zip
open-keychain-31b27e59ee8f578be35df1e4ece3c4381c5dfae5.tar.gz
open-keychain-31b27e59ee8f578be35df1e4ece3c4381c5dfae5.tar.bz2
add ACTION_CHECK_PERMISSION for a simple permission check
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java13
m---------extern/openpgp-api-lib0
2 files changed, 13 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
index d92393e..91d3cda 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java
@@ -674,6 +674,16 @@ public class OpenPgpService extends Service {
}
}
+ private Intent checkPermissionImpl(@NonNull Intent data) {
+ Intent permissionIntent = mApiPermissionHelper.isAllowedOrReturnIntent(data);
+ if (permissionIntent != null) {
+ return permissionIntent;
+ }
+ Intent result = new Intent();
+ result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS);
+ return result;
+ }
+
private Intent getSignKeyMasterId(Intent data) {
// NOTE: Accounts are deprecated on API version >= 7
if (data.getIntExtra(OpenPgpApi.EXTRA_API_VERSION, -1) < 7) {
@@ -803,6 +813,9 @@ public class OpenPgpService extends Service {
String action = data.getAction();
switch (action) {
+ case OpenPgpApi.ACTION_CHECK_PERMISSION: {
+ return checkPermissionImpl(data);
+ }
case OpenPgpApi.ACTION_CLEARTEXT_SIGN: {
return signImpl(data, inputStream, outputStream, true);
}
diff --git a/extern/openpgp-api-lib b/extern/openpgp-api-lib
-Subproject 075616c461f5ce2bd76a4078c31a51a6ee6b860
+Subproject e177b56ab36056f6e79fc0ae4dc4875c9a2941f