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

Commit 17464134 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Fix typo & exact veriable according to review

parent f918d70d
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -37,14 +37,16 @@ public class ImportMurenaAccountViewModel extends AndroidViewModel {
    }

    private void retrieveAccount() {
        List<Account> accounts = AccountSyncUtil.getMuenaAccounts(getApplication());
        List<Account> accounts = AccountSyncUtil.getMurenaAccounts(getApplication());

        if (accounts.isEmpty()) {
            return;
        }

        if (AccountSyncUtil.isSyncEnable(accounts.get(0))) {
            account = accounts.get(0); // retrieve the first account, as we have policy that one murena account per device
        Account murenaAccount = accounts.get(0); // retrieve the first account, as we have policy that one murena account per device

        if (AccountSyncUtil.isSyncEnable(murenaAccount)) {
            account = murenaAccount;
        }
    }

+0 −3
Original line number Diff line number Diff line
@@ -20,7 +20,4 @@ public final class MurenaAccountConstants {

    public static final String MURENA_ACCOUNT_TYPE = "e.foundation.webdav.eelo";
    public static final String NOTES_CONTENT_AUTHORITY = "foundation.e.notes.android.providers.AppContentProvider";

    private MurenaAccountConstants() {
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public final class AccountSyncUtil {

    public static boolean isSyncEnable(Context context, Account account) {
        try {
            List<android.accounts.Account> murenaAccounts = getMuenaAccounts(context);
            List<android.accounts.Account> murenaAccounts = getMurenaAccounts(context);

            for (android.accounts.Account murenaAccount : murenaAccounts) {
                if (account.getAccountName().equals(murenaAccount.name)) {
@@ -58,7 +58,7 @@ public final class AccountSyncUtil {
        return true;
    }

    public static List<android.accounts.Account> getMuenaAccounts(Context context) {
    public static List<android.accounts.Account> getMurenaAccounts(Context context) {
        AccountManager accountManager = AccountManager.get(context);
        return Arrays.stream(accountManager.getAccountsByType(MurenaAccountConstants.MURENA_ACCOUNT_TYPE))
                .filter(Objects::nonNull)