mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 13:15:35 +03:00
always start with no account
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
acbb2f06bf
commit
7a3ef013d1
1 changed files with 6 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue