@Test public void testAccountExistsReturnsTrueIfDbDirectoryIsDirectory() throws Exception { storeDatabaseKey(keyFile, encryptedKeyHex); storeDatabaseKey(keyBackupFile, encryptedKeyHex); assertTrue(dbDir.mkdirs()); assertTrue(dbDir.isDirectory()); assertTrue(accountManager.accountExists()); assertEquals(encryptedKeyHex, loadDatabaseKey(keyFile)); assertEquals(encryptedKeyHex, loadDatabaseKey(keyBackupFile)); assertTrue(dbDir.exists()); assertTrue(dbDir.isDirectory()); }
@Override public boolean accountExists() { synchronized (stateChangeLock) { return loadEncryptedDatabaseKey() != null && databaseConfig.getDatabaseDirectory().isDirectory(); } }
AccountManagerImpl implements AccountManager { @Override public boolean accountExists() { synchronized (stateChangeLock) { return loadEncryptedDatabaseKey() != null && databaseConfig.getDatabaseDirectory().isDirectory(); } } }
AccountManagerImpl implements AccountManager { @Override public boolean accountExists() { synchronized (stateChangeLock) { return loadEncryptedDatabaseKey() != null && databaseConfig.getDatabaseDirectory().isDirectory(); } } @Inject  AccountManagerImpl(DatabaseConfig databaseConfig, CryptoComponent crypto,
			IdentityManager identityManager); }
AccountManagerImpl implements AccountManager { @Override public boolean accountExists() { synchronized (stateChangeLock) { return loadEncryptedDatabaseKey() != null && databaseConfig.getDatabaseDirectory().isDirectory(); } } @Inject  AccountManagerImpl(DatabaseConfig databaseConfig, CryptoComponent crypto,
			IdentityManager identityManager); @Override boolean hasDatabaseKey(); @Override @Nullable SecretKey getDatabaseKey(); @Override boolean accountExists(); @Override boolean createAccount(String name, String password); @Override void deleteAccount(); @Override boolean signIn(String password); @Override boolean changePassword(String oldPassword, String newPassword); }
AccountManagerImpl implements AccountManager { @Override public boolean accountExists() { synchronized (stateChangeLock) { return loadEncryptedDatabaseKey() != null && databaseConfig.getDatabaseDirectory().isDirectory(); } } @Inject  AccountManagerImpl(DatabaseConfig databaseConfig, CryptoComponent crypto,
			IdentityManager identityManager); @Override boolean hasDatabaseKey(); @Override @Nullable SecretKey getDatabaseKey(); @Override boolean accountExists(); @Override boolean createAccount(String name, String password); @Override void deleteAccount(); @Override boolean signIn(String password); @Override boolean changePassword(String oldPassword, String newPassword);  }