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

Commit 56a57bb6 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding item rank when parsing a folder

Bug: 22059402
Change-Id: Ie57f2dd58d2b4bc2eb277f10e93a25d026d1cdd2
parent 2598d3ce
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -580,6 +580,7 @@ public class AutoInstallsLayout {

            int type;
            int folderDepth = parser.getDepth();
            int rank = 0;
            while ((type = parser.next()) != XmlPullParser.END_TAG ||
                    parser.getDepth() > folderDepth) {
                if (type != XmlPullParser.START_TAG) {
@@ -587,12 +588,14 @@ public class AutoInstallsLayout {
                }
                mValues.clear();
                mValues.put(Favorites.CONTAINER, folderId);
                mValues.put(Favorites.RANK, rank);

                TagParser tagParser = mFolderElements.get(parser.getName());
                if (tagParser != null) {
                    final long id = tagParser.parseAndAdd(parser);
                    if (id >= 0) {
                        folderItems.add(id);
                        rank++;
                    }
                } else {
                    throw new RuntimeException("Invalid folder item " + parser.getName());