Loading app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java +9 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.fsck.k9.activity.setup.accountmanager; import java.util.List; import java.util.stream.Collectors; import android.accounts.AccountManager; import android.content.ContentResolver; Loading Loading @@ -65,11 +66,17 @@ public class EeloAccountCreator { List<Account> accounts = preferences.getAccounts(); deleteIncompleteAccounts(accounts, accountRemover); // deleteIncompleteAccounts is asynchronous. // The second time we call preferences.getAccounts() // The accounts might not yet be removed List<Account> finalAccounts = accounts.stream() .filter(Account::isFinishedSetup) .collect(Collectors.toList()); loadEeloAccounts(context, accounts, accountManager, jobManager); loadEeloAccounts(context, finalAccounts, accountManager, jobManager); AccountManagerConstants.INSTANCE.getOPENID_ACCOUNT_TYPES() .forEach(accountType -> loadOpenIdAccounts(context, accountType, accounts, accountManager, jobManager)); .forEach(accountType -> loadOpenIdAccounts(context, accountType, finalAccounts, accountManager, jobManager)); } catch (SecurityException e) { Timber.e(e, "Failed to load accounts from accountManager because of security violation"); } Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java +9 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.fsck.k9.activity.setup.accountmanager; import java.util.List; import java.util.stream.Collectors; import android.accounts.AccountManager; import android.content.ContentResolver; Loading Loading @@ -65,11 +66,17 @@ public class EeloAccountCreator { List<Account> accounts = preferences.getAccounts(); deleteIncompleteAccounts(accounts, accountRemover); // deleteIncompleteAccounts is asynchronous. // The second time we call preferences.getAccounts() // The accounts might not yet be removed List<Account> finalAccounts = accounts.stream() .filter(Account::isFinishedSetup) .collect(Collectors.toList()); loadEeloAccounts(context, accounts, accountManager, jobManager); loadEeloAccounts(context, finalAccounts, accountManager, jobManager); AccountManagerConstants.INSTANCE.getOPENID_ACCOUNT_TYPES() .forEach(accountType -> loadOpenIdAccounts(context, accountType, accounts, accountManager, jobManager)); .forEach(accountType -> loadOpenIdAccounts(context, accountType, finalAccounts, accountManager, jobManager)); } catch (SecurityException e) { Timber.e(e, "Failed to load accounts from accountManager because of security violation"); } Loading