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

Commit e1486520 authored by thiruram's avatar thiruram Committed by Thiru Ramasamy
Browse files

Fixes missing folder label after launcher restarts.

Rootcause: FolderInfo was persisted into DB only when folder options are updated. Hence when folder was created (Folder option remains suggested) its title was not persisted into DB.

Fix: Persists folderInfo into DB always whenever title is updated

Bug: 159904890
Change-Id: If0d20b0d7fa6966dd7bb40a2c07bcb22bd0893e0
(cherry picked from commit 6ab4da8a)
parent 6b79a376
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ public class FolderInfo extends ItemInfo {
        }

        // Updating title to same value does not change any states.
        if (title != null && title == this.title) {
        if (title != null && title.equals(this.title)) {
            return;
        }

@@ -236,7 +236,15 @@ public class FolderInfo extends ItemInfo {
                        : title.length() == 0 ? LabelState.EMPTY :
                                getAcceptedSuggestionIndex().isPresent() ? LabelState.SUGGESTED
                                        : LabelState.MANUAL;
        setOption(FLAG_MANUAL_FOLDER_NAME, newLabelState.equals(LabelState.MANUAL), modelWriter);

        if (newLabelState.equals(LabelState.MANUAL)) {
            options |= FLAG_MANUAL_FOLDER_NAME;
        } else {
            options &= ~FLAG_MANUAL_FOLDER_NAME;
        }
        if (modelWriter != null) {
            modelWriter.updateItemInDatabase(this);
        }
    }

    /**