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

Commit b483a99c authored by Amith Yamasani's avatar Amith Yamasani
Browse files

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
parent 5ab6e12b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);