* If a file URI is given, the file is encrypted.\r
* The new file URI is returned.\r
* \r
+ * If the extra EXTRA_SESSION_KEY is provided, the session key is returned,\r
+ * and the content URI is returned in the data field.\r
+ * \r
* Returns all encrypted string in the same extra(s).\r
* \r
* <p>Constant Value: "org.openintents.action.ENCRYPT"</p>\r
* If a file URI is given, the file is decrypted.\r
* The new file URI is returned.\r
* \r
+ * If the extra EXTRA_SESSION_KEY is provided, the session key is returned,\r
+ * and the content URI is returned in the data field.\r
+ * \r
* Returns all decrypted string in the same extra(s).\r
* \r
* <p>Constant Value: "org.openintents.action.DECRYPT"</p>\r
* \r
* Include this extra with non-empty value to the ENCRYPT or DECRYPT action,\r
* and the resulting intent will contain the current session key, valid until\r
- * OI Safe logs out.\r
+ * OI Safe logs out, and the content URI as data.\r
* \r
* <p>Constant Value: "org.openintents.extra.SESSION_KEY"</p>\r
*/\r
}\r
callbackIntent.putExtra(CryptoIntents.EXTRA_TEXT_ARRAY, out);\r
}\r
-\r
- if (thisIntent.hasExtra(CryptoIntents.EXTRA_SESSION_KEY)) {\r
- String sessionkey = ch.getCurrentSessionKey();\r
- callbackIntent.putExtra(CryptoIntents.EXTRA_SESSION_KEY, sessionkey);\r
- }\r
\r
if (thisIntent.getData() != null) {\r
// Encrypt file from file URI\r
\r
callbackIntent.setData(newFileUri);\r
}\r
- // Support for binary fields could be added here (like images?)\r
+\r
+ if (thisIntent.hasExtra(CryptoIntents.EXTRA_SESSION_KEY)) {\r
+ String sessionkey = ch.getCurrentSessionKey();\r
+ callbackIntent.putExtra(CryptoIntents.EXTRA_SESSION_KEY, sessionkey);\r
+ \r
+ // Warning! This overwrites any data intent set previously.\r
+ callbackIntent.setData(CryptoContentProvider.CONTENT_URI);\r
+ }\r
\r
callbackResult = RESULT_OK;\r
} catch (CryptoHelperException e) {\r
callbackIntent.putExtra(CryptoIntents.EXTRA_TEXT_ARRAY, out);\r
}\r
\r
- if (thisIntent.hasExtra(CryptoIntents.EXTRA_SESSION_KEY)) {\r
- String sessionkey = ch.getCurrentSessionKey();\r
- callbackIntent.putExtra(CryptoIntents.EXTRA_SESSION_KEY, sessionkey);\r
- }\r
- \r
if (thisIntent.getData() != null) {\r
// Decrypt file from file URI\r
Uri fileUri = thisIntent.getData();\r
\r
callbackIntent.setData(newFileUri);\r
}\r
- // Support for binary fields could be added here (like images?)\r
+ \r
+ if (thisIntent.hasExtra(CryptoIntents.EXTRA_SESSION_KEY)) {\r
+ String sessionkey = ch.getCurrentSessionKey();\r
+ callbackIntent.putExtra(CryptoIntents.EXTRA_SESSION_KEY, sessionkey);\r
+ \r
+ // Warning! This overwrites any data intent set previously.\r
+ callbackIntent.setData(CryptoContentProvider.CONTENT_URI);\r
+ }\r
\r
callbackResult = RESULT_OK;\r
} catch (CryptoHelperException e) {\r