*/\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
* @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
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
//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