commit | 69eb99109242ced6a1231b1ec9e5d6fc975f8489 | [log] [tgz] |
---|---|---|
author | Tarandeep Singh <tarandeep@google.com> | Tue Mar 26 11:26:58 2019 -0700 |
committer | Tarandeep Singh <tarandeep@google.com> | Tue Mar 26 11:45:40 2019 -0700 |
tree | 156f19a1920dd359c9e573a0b8b59112af306c1c | |
parent | ed8b0aebea96ff411aeddda3e9ad5f397145d82b [diff] |
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
diff --git a/src/com/android/settings/inputmethod/UserDictionaryListPreferenceController.java b/src/com/android/settings/inputmethod/UserDictionaryListPreferenceController.java index 4a409e1..9343493 100644 --- a/src/com/android/settings/inputmethod/UserDictionaryListPreferenceController.java +++ b/src/com/android/settings/inputmethod/UserDictionaryListPreferenceController.java
@@ -174,7 +174,10 @@ 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); + } } } }