diff options
author | Michael Chan <chanm@google.com> | 2012-05-23 17:43:56 -0700 |
---|---|---|
committer | Michael Chan <chanm@google.com> | 2012-05-23 17:51:44 -0700 |
commit | 65cf22bc9170c8aa6a26ef0bf91888a0ae1afaeb (patch) | |
tree | 96b083d24a4c5da733d22160cf817ba67cc86486 /src/com/android/calendar/selectcalendars | |
parent | 96d059fba7e9c1fa215b7a857c5d39efd787e84c (diff) | |
download | android_packages_apps_Calendar-65cf22bc9170c8aa6a26ef0bf91888a0ae1afaeb.tar.gz android_packages_apps_Calendar-65cf22bc9170c8aa6a26ef0bf91888a0ae1afaeb.tar.bz2 android_packages_apps_Calendar-65cf22bc9170c8aa6a26ef0bf91888a0ae1afaeb.zip |
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
Diffstat (limited to 'src/com/android/calendar/selectcalendars')
-rw-r--r-- | src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java b/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java index 5b291bd2..58b99ebf 100644 --- a/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java +++ b/src/com/android/calendar/selectcalendars/SelectSyncedCalendarsMultiAccountAdapter.java @@ -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*/, |