]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
OI Safe: Fix issue 179: getSetPassword was called before onResume(), therefore dbHelp...
authorpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Sat, 17 Jan 2009 06:31:58 +0000 (06:31 +0000)
committerpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Sat, 17 Jan 2009 06:31:58 +0000 (06:31 +0000)
git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@1743 72b678ce-9140-0410-bee8-679b907dd61a

src/org/openintents/safe/FrontDoor.java

index 74d3c6f81cbcd057a66a4e3c1e78d305425d5f88..6bc6cf7cac4629176ad71b3761c760ce8f2a6997 100644 (file)
@@ -129,12 +129,12 @@ public class FrontDoor extends Activity {
                                callbackIntent = getSetPassword (thisIntent, callbackIntent);\r
                        callbackResult = RESULT_OK;\r
                        } catch (CryptoHelperException e) {\r
-                               Log.e(TAG, e.toString());\r
+                               Log.e(TAG, e.toString(), e);\r
                                Toast.makeText(FrontDoor.this,\r
                                                "There was a crypto error while retreiving the requested password: " + e.getMessage(),\r
                                                Toast.LENGTH_SHORT).show();\r
                        } catch (Exception e) {\r
-                               Log.e(TAG, e.toString());\r
+                               Log.e(TAG, e.toString(), e);\r
                                //TODO: Turn this into a proper error dialog.\r
                                Toast.makeText(FrontDoor.this,\r
                                                "There was an error in retreiving the requested password: " + e.getMessage(),\r
@@ -237,6 +237,12 @@ public class FrontDoor extends Activity {
         String clearUniqueName = thisIntent.getStringExtra (CryptoIntents.EXTRA_UNIQUE_NAME);\r
 \r
         if (clearUniqueName == null) throw new Exception ("EXTRA_UNIQUE_NAME not set.");\r
+        \r
+               if (dbHelper == null) {\r
+               // Need to open DBHelper here, because\r
+                       // onResume() is called after onActivityResult()\r
+                       dbHelper = new DBHelper(this);\r
+               }\r
 \r
         String uniqueName = ch.encrypt(clearUniqueName);\r
        PassEntry row = dbHelper.fetchPassword(uniqueName);\r