always start with no account

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-07-17 13:37:04 +02:00
parent acbb2f06bf
commit 7a3ef013d1
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -68,10 +68,15 @@ public class DrawerActivityIT extends AbstractOnServerIT {
String loginName = "user1";
String password = "user1";
AccountManager platformAccountManager = AccountManager.get(targetContext);
for (Account account : platformAccountManager.getAccounts()) {
platformAccountManager.removeAccountExplicitly(account);
}
Account temp = new Account(loginName + "@" + baseUrl, MainApp.getAccountType(targetContext));
UserAccountManager accountManager = UserAccountManagerImpl.fromContext(targetContext);
if (!accountManager.exists(temp)) {
AccountManager platformAccountManager = AccountManager.get(targetContext);
platformAccountManager.addAccountExplicitly(temp, password, null);
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_ACCOUNT_VERSION,
Integer.toString(UserAccountManager.ACCOUNT_VERSION));