aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2016-02-15 18:09:27 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2016-02-22 15:06:45 +0100
commit6379ce1faa3a0ebf5b88b5c20fd465119535554c (patch)
tree89aedd1a990d7f79d120e60247714688650f75fd /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote
parentd1eacf9b277c679fac7d873d5fe42c5493498f09 (diff)
downloadopen-keychain-6379ce1faa3a0ebf5b88b5c20fd465119535554c.tar.gz
open-keychain-6379ce1faa3a0ebf5b88b5c20fd465119535554c.tar.bz2
open-keychain-6379ce1faa3a0ebf5b88b5c20fd465119535554c.zip
Use FLAG_IMMUTABLE
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ApiPendingIntentFactory.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ApiPendingIntentFactory.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ApiPendingIntentFactory.java
index 2cd463934..3ebb8b638 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ApiPendingIntentFactory.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ApiPendingIntentFactory.java
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.remote;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.os.Build;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.remote.ui.RemoteCreateAccountActivity;
@@ -147,9 +148,16 @@ public class ApiPendingIntentFactory {
// re-attach "data" for pass through. It will be used later to repeat pgp operation
intent.putExtra(RemoteSecurityTokenOperationActivity.EXTRA_DATA, mPendingIntentData);
- return PendingIntent.getActivity(mContext, 0,
- intent,
- PendingIntent.FLAG_CANCEL_CURRENT);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ //noinspection ResourceType, looks like lint is missing FLAG_IMMUTABLE
+ return PendingIntent.getActivity(mContext, 0,
+ intent,
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
+ } else {
+ return PendingIntent.getActivity(mContext, 0,
+ intent,
+ PendingIntent.FLAG_CANCEL_CURRENT);
+ }
}
PendingIntent register(String packageName, byte[] packageCertificate) {
@@ -158,9 +166,17 @@ public class ApiPendingIntentFactory {
intent.putExtra(RemoteRegisterActivity.EXTRA_PACKAGE_SIGNATURE, packageCertificate);
intent.putExtra(RemoteRegisterActivity.EXTRA_DATA, mPendingIntentData);
- return PendingIntent.getActivity(mContext, 0,
- intent,
- PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ //noinspection ResourceType, looks like lint is missing FLAG_IMMUTABLE
+ return PendingIntent.getActivity(mContext, 0,
+ intent,
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT
+ | PendingIntent.FLAG_IMMUTABLE);
+ } else {
+ return PendingIntent.getActivity(mContext, 0,
+ intent,
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
+ }
}
}