Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit 41bf90c9 authored by Mohammed Althaf Thayyil's avatar Mohammed Althaf Thayyil :blush:
Browse files

mail: Fix yahoo login for existing users

parent 8e0ba0d9
Branches
No related tags found
1 merge request!170mail: Fix yahoo login for existing users
Pipeline #460156 passed
......@@ -98,8 +98,8 @@ public class EeloAccountCreator {
android.accounts.Account[] openIdAccounts =
accountManager.getAccountsByType(accountType);
for (android.accounts.Account openIdAccount : openIdAccounts) {
String emailId =
accountManager.getUserData(openIdAccount, AccountManagerConstants.ACCOUNT_EMAIL_ADDRESS_KEY);
final String emailId = getEmailId(accountManager, openIdAccount);
if (isInvalidEmail(emailId)) {
continue;
}
......@@ -149,7 +149,8 @@ public class EeloAccountCreator {
android.accounts.Account[] eeloAccounts =
accountManager.getAccountsByType(AccountManagerConstants.EELO_ACCOUNT_TYPE);
for (android.accounts.Account eeloAccount : eeloAccounts) {
String emailId = accountManager.getUserData(eeloAccount, AccountManagerConstants.ACCOUNT_EMAIL_ADDRESS_KEY);
final String emailId = getEmailId(accountManager, eeloAccount);
if (isInvalidEmail(emailId)) {
continue;
}
......@@ -176,6 +177,16 @@ public class EeloAccountCreator {
}
}
private static String getEmailId(AccountManager accountManager, android.accounts.Account account) {
String emailId = accountManager.getUserData(account, AccountManagerConstants.ACCOUNT_EMAIL_ADDRESS_KEY);
if (emailId == null || emailId.equals("null") || emailId.isBlank()) {
return account.name;
}
return emailId;
}
@RequiresApi(api = VERSION_CODES.N)
private static void deleteIncompleteAccounts(List<Account> accounts, BackgroundAccountRemover accountRemover) {
accounts.stream().filter(account -> !account.isFinishedSetup())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment