diff options
| author | Amith Yamasani <yamasani@google.com> | 2012-05-22 13:14:25 -0700 |
|---|---|---|
| committer | Amith Yamasani <yamasani@google.com> | 2012-05-30 13:58:38 -0700 |
| commit | b483a99c6bdfee72fbb8fbcf893e63ef3f54658b (patch) | |
| tree | f1ac73684dee934f07a82b40d1500d55cc177aad /core/java | |
| parent | 5ab6e12b450d13c8eb501001c7a8669826b86ea4 (diff) | |
| download | frameworks_base-b483a99c6bdfee72fbb8fbcf893e63ef3f54658b.zip frameworks_base-b483a99c6bdfee72fbb8fbcf893e63ef3f54658b.tar.gz frameworks_base-b483a99c6bdfee72fbb8fbcf893e63ef3f54658b.tar.bz2 | |
Preserve account list in order of creation in the database.
This makes it possible to retrieve the account list in the order of creation,
if we want to display them in the account settings screen in that order.
Bug: 6579937
Change-Id: I2025aaa8b770fbb78be978dfde64ef95823fd5aa
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/accounts/AccountManagerService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index 2b643c2..306159dd 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -163,7 +163,8 @@ public class AccountManagerService new HashMap<Account, Integer>(); private final Object cacheLock = new Object(); /** protected by the {@link #cacheLock} */ - private final HashMap<String, Account[]> accountCache = new HashMap<String, Account[]>(); + private final HashMap<String, Account[]> accountCache = + new LinkedHashMap<String, Account[]>(); /** protected by the {@link #cacheLock} */ private HashMap<Account, HashMap<String, String>> userDataCache = new HashMap<Account, HashMap<String, String>>(); @@ -296,7 +297,7 @@ public class AccountManagerService try { accounts.accountCache.clear(); final HashMap<String, ArrayList<String>> accountNamesByType = - new HashMap<String, ArrayList<String>>(); + new LinkedHashMap<String, ArrayList<String>>(); while (cursor.moveToNext()) { final long accountId = cursor.getLong(0); final String accountType = cursor.getString(1); |
