]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
Include direct connection via service.
authorpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Sat, 17 Jan 2009 10:15:54 +0000 (10:15 +0000)
committerpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Sat, 17 Jan 2009 10:15:54 +0000 (10:15 +0000)
git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@1746 72b678ce-9140-0410-bee8-679b907dd61a

src/org/openintents/safe/FrontDoor.java

index 6bc6cf7cac4629176ad71b3761c760ce8f2a6997..c4b8e7458dba22cba63a2f5793517f05880e24a1 100644 (file)
@@ -47,7 +47,7 @@ import android.widget.Toast;
  */\r
 public class FrontDoor extends Activity {\r
 \r
-       private boolean debug = false;\r
+       private static final boolean debug = !false;\r
        private static String TAG = "FrontDoor";\r
 \r
        private DBHelper dbHelper;\r
@@ -155,6 +155,9 @@ public class FrontDoor extends Activity {
         * @return callbackResult\r
         */\r
        private int encryptIntent(final Intent thisIntent, Intent callbackIntent) {\r
+               if (debug)\r
+                       Log.d(TAG, "encryptIntent()");\r
+               \r
                int callbackResult = RESULT_CANCELED;\r
                try {\r
                        if (thisIntent.hasExtra(CryptoIntents.EXTRA_TEXT)) {\r
@@ -372,10 +375,11 @@ public class FrontDoor extends Activity {
                        service = ServiceDispatch.Stub.asInterface((IBinder)boundService);\r
                        \r
                        boolean promptforpassword = getIntent().getBooleanExtra(CryptoIntents.EXTRA_PROMPT, true);\r
-                       \r
+                       if (debug) Log.d(TAG, "Prompt for password: " + promptforpassword);\r
                        try {\r
                                if (service.getPassword() == null) {\r
                                        if (promptforpassword) {\r
+                                               if (debug) Log.d(TAG, "ask for password");\r
                                                // the service isn't running\r
                                                Intent askPass = new Intent(getApplicationContext(),\r
                                                                AskPassword.class);\r
@@ -388,12 +392,14 @@ public class FrontDoor extends Activity {
                                                //TODO: Is there a way to make sure all the extras are set?     \r
                                                startActivityForResult (askPass, 0);\r
                                        } else {\r
+                                               if (debug) Log.d(TAG, "ask for password");\r
                                                // Don't prompt but cancel\r
                                                setResult(RESULT_CANCELED);\r
                                        finish();\r
                                        }\r
 \r
                                } else {\r
+                                       if (debug) Log.d(TAG, "service already started");\r
                                        //service already started, so don't need to ask pw.\r
                                        masterKey = service.getPassword();\r
                                        actionDispatch();\r