mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Dont use an observer when adding contacts
This commit is contained in:
@@ -30,7 +30,7 @@ import static java.util.logging.Logger.getLogger;
|
|||||||
|
|
||||||
@MethodsNotNullByDefault
|
@MethodsNotNullByDefault
|
||||||
@ParametersNotNullByDefault
|
@ParametersNotNullByDefault
|
||||||
class RestoreAccountViewModel extends AndroidViewModel implements RestoreAccount.Observer {
|
class RestoreAccountViewModel extends AndroidViewModel {
|
||||||
|
|
||||||
enum State {SET_PASSWORD, DOZE, CREATED, FAILED}
|
enum State {SET_PASSWORD, DOZE, CREATED, FAILED}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class RestoreAccountViewModel extends AndroidViewModel implements RestoreAccount
|
|||||||
if (accountManager.restoreAccount(identity, password)) {
|
if (accountManager.restoreAccount(identity, password)) {
|
||||||
LOG.info("Restored account");
|
LOG.info("Restored account");
|
||||||
try {
|
try {
|
||||||
restoreAccount.addContactsToDb(this);
|
restoreAccount.addContactsToDb();
|
||||||
} catch (DbException e) {
|
} catch (DbException e) {
|
||||||
LOG.warning("Cannot retrieve social backup");
|
LOG.warning("Cannot retrieve social backup");
|
||||||
state.postEvent(State.FAILED);
|
state.postEvent(State.FAILED);
|
||||||
@@ -130,14 +130,4 @@ class RestoreAccountViewModel extends AndroidViewModel implements RestoreAccount
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAddingContactsFinished(boolean success) {
|
|
||||||
if (success) {
|
|
||||||
LOG.info("Added recovered contacts to database");
|
|
||||||
} else {
|
|
||||||
LOG.warning("Error when adding contacts to database");
|
|
||||||
// state.postEvent(State.FAILED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user