Fix dupicate preference in personal dict

Duplicate preference is added on the
UserDictionaryListPreferenceController. With this change, we check
before adding.

Fix: 129079798
Test: Manually using steps mentioned in bug
Change-Id: If73880f3be460f377b8985a44fc9f9fbe6370c06
This commit is contained in:
Tarandeep Singh
2019-03-26 11:26:58 -07:00
parent ed8b0aebea
commit 69eb991092

View File

@@ -174,7 +174,10 @@ public class UserDictionaryListPreferenceController extends BasePreferenceContro
mScreen.addPreference(createUserDictionaryPreference(null));
} else {
for (String locale : localeSet) {
mScreen.addPreference(createUserDictionaryPreference(locale));
final Preference pref = createUserDictionaryPreference(locale);
if (mScreen.findPreference(pref.getKey()) == null) {
mScreen.addPreference(pref);
}
}
}
}