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

Commit 65cf22bc authored by Michael Chan's avatar Michael Chan
Browse files

Fixed crash in "calendar to sync" when there are accounts with identical email addresses

If there are multiple accounts with the same account_name,
"Calendar to sync" would crash because we are closing the same cursor multiple times.
There's a hashmap which uses the account_email as the key and ignores the account_type.

Bug: 6540605
Change-Id: I0c39bece20b8a56d2d4b9ca002efe6342287484a
parent 96d059fb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ public class SelectSyncedCalendarsMultiAccountAdapter extends CursorTreeAdapter
        String account = groupCursor.getString(accountColumn);
        String accountType = groupCursor.getString(accountTypeColumn);
        //Get all the calendars for just this account.
        Cursor childCursor = mChildrenCursors.get(account);
        Cursor childCursor = mChildrenCursors.get(accountType + "#" + account);
        new RefreshCalendars(groupCursor.getPosition(), account, accountType).run();
        return childCursor;
    }
@@ -357,9 +357,9 @@ public class SelectSyncedCalendarsMultiAccountAdapter extends CursorTreeAdapter
        String mAccount;
        String mAccountType;

        public RefreshCalendars(int token, String cookie, String accountType) {
        public RefreshCalendars(int token, String account, String accountType) {
            mToken = token;
            mAccount = cookie;
            mAccount = account;
            mAccountType = accountType;
        }

@@ -371,7 +371,7 @@ public class SelectSyncedCalendarsMultiAccountAdapter extends CursorTreeAdapter
                        REFRESH_DELAY);
            }
            mCalendarsUpdater.startQuery(mToken,
                    mAccount,
                    mAccountType + "#" + mAccount,
                    Calendars.CONTENT_URI, PROJECTION,
                    ACCOUNT_SELECTION,
                    new String[] { mAccount, mAccountType } /*selectionArgs*/,