]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
OI Safe: Return content provider URI for future compatibility with other safes.
authorpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Fri, 1 May 2009 16:03:30 +0000 (16:03 +0000)
committerpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Fri, 1 May 2009 16:03:30 +0000 (16:03 +0000)
git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@2061 72b678ce-9140-0410-bee8-679b907dd61a

src/org/openintents/intents/CryptoIntents.java
src/org/openintents/safe/IntentHandler.java

index a55cd7ee0791a9f04686a1df7dcb77746dd31423..4b6678becf088603b86d6113c386687afd8b2353 100644 (file)
@@ -31,6 +31,9 @@ public class CryptoIntents {
         * 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
@@ -44,6 +47,9 @@ public class CryptoIntents {
         * 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
@@ -117,7 +123,7 @@ public class CryptoIntents {
         * \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
index 7911cf0fbfdceed54093f765238b00a6c7cc896d..4b1e34f832bdcbfd1c0451ff60d7ff68ca8f41ae 100644 (file)
@@ -270,11 +270,6 @@ public class IntentHandler extends Activity {
                                }\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
@@ -284,7 +279,14 @@ public class IntentHandler extends Activity {
                                \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
@@ -324,11 +326,6 @@ public class IntentHandler extends Activity {
                                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
@@ -337,7 +334,14 @@ public class IntentHandler extends Activity {
                                \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