Fixes incorrect FromFolderLabelState in clearcut log when updating folder label.
Bug description: When folder label is updated from a suggested label to a custom label,
EditFolderLabelEvent log expected to have FromFolderLabelState = FROM_SUGGESTED.
Currently FromFolderLabelState is logged as FROM_CUSTOM in such scenarios.
Root cause: Folder label state is decided based on whether IME has entered into compose mode while editing.
This works fine for initial folder creation and also updated to non-empty label(to both custom or suggested).
But when folder is edited from suggested to empty label, its internal state changes from SUGGESTED to CUSTOM as expected.
Later when empty label is updated to suggested again, its internal state remains custom forever.
Fix: Instead of setting folder's internal state based on IME's compose mode, comparing actual folder label with suggestions
and set it to SUGGESTED if any suggestion matches else CUSTOM.
Change-Id: Ieea572ee93fd5567e3128c9bbcea3b670f0f01d9
2 files changed