aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-08-04 14:44:11 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-08-04 14:44:11 +0200
commitc4311e2f52e5870ccfd67d34fa7c364ecd160753 (patch)
tree202ba5a3ea35c5b685aaa026bf9e7a48d01dd525 /OpenKeychain
parent839294d27c4f8b3ac22573a1d429bc230f641bd2 (diff)
downloadopen-keychain-c4311e2f52e5870ccfd67d34fa7c364ecd160753.tar.gz
open-keychain-c4311e2f52e5870ccfd67d34fa7c364ecd160753.tar.bz2
open-keychain-c4311e2f52e5870ccfd67d34fa7c364ecd160753.zip
Remove support for IO_FILE, this is no longer used and was never a good practice, use IO_URI on Android!
Diffstat (limited to 'OpenKeychain')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index b45359a10..601f45fed 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -110,9 +110,8 @@ public class KeychainIntentService extends IntentService
public static final String SOURCE = "source";
// possible targets:
public static final int IO_BYTES = 1;
- public static final int IO_FILE = 2; // This was misleadingly TARGET_URI before!
- public static final int IO_URI = 3;
- public static final int IO_URIS = 4;
+ public static final int IO_URI = 2;
+ public static final int IO_URIS = 3;
public static final String SELECTED_URI = "selected_uri";
@@ -716,16 +715,6 @@ public class KeychainIntentService extends IntentService
byte[] bytes = data.getByteArray(bytesName);
return new InputData(new ByteArrayInputStream(bytes), bytes.length);
- case IO_FILE: /* encrypting file */
- String inputFile = data.getString(ENCRYPT_INPUT_FILE);
-
- // check if storage is ready
- if (!FileHelper.isStorageMounted(inputFile)) {
- throw new PgpGeneralException(getString(R.string.error_external_storage_not_ready));
- }
-
- return new InputData(new FileInputStream(inputFile), new File(inputFile).length());
-
case IO_URI: /* encrypting content uri */
Uri providerUri = data.getParcelable(ENCRYPT_INPUT_URI);
@@ -749,18 +738,6 @@ public class KeychainIntentService extends IntentService
case IO_BYTES:
return new ByteArrayOutputStream();
- case IO_FILE:
- String outputFile = data.getString(ENCRYPT_OUTPUT_FILE);
-
- // check if storage is ready
- if (!FileHelper.isStorageMounted(outputFile)) {
- throw new PgpGeneralException(
- getString(R.string.error_external_storage_not_ready));
- }
-
- // OutputStream
- return new FileOutputStream(outputFile);
-
case IO_URI:
Uri providerUri = data.getParcelable(ENCRYPT_OUTPUT_URI);
@@ -791,10 +768,6 @@ public class KeychainIntentService extends IntentService
byte output[] = ((ByteArrayOutputStream) outStream).toByteArray();
resultData.putByteArray(bytesName, output);
break;
- case IO_FILE:
- // nothing, file was written, just send okay and verification bundle
-
- break;
case IO_URI:
case IO_URIS:
// nothing, output was written, just send okay and verification bundle