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 6ab4da8aa0)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user