From 87472f00382c36f475dcaa1932af70b482adf1c3 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 12 Sep 2013 15:02:24 +0900 Subject: Remove changing a word when added to the dictionary This code is now useless. I thought it affected 9902905, but it seems it actually does not. Still, it's dead code. Bug: 9902905 Change-Id: Id9c90fbf88f015af47b2368b90d173c481647093 --- .../inputmethod/latin/UserBinaryDictionary.java | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/UserBinaryDictionary.java') diff --git a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java index b2bb61596..a241b5505 100644 --- a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java @@ -103,14 +103,6 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary { @Override public void onChange(final boolean self, final Uri uri) { setRequiresReload(true); - // We want to report back to Latin IME in case the user just entered the word. - // If the user changed the word in the dialog box, then we want to replace - // what was entered in the text field. - if (null == uri || !(context instanceof LatinIME)) return; - final long changedRowId = ContentUris.parseId(uri); - if (-1 == changedRowId) return; // Unknown content... Not sure why we're here - final String changedWord = getChangedWordForUri(uri); - ((LatinIME)context).onWordAddedToUserDictionary(changedWord); } }; cres.registerContentObserver(Words.CONTENT_URI, true, mObserver); @@ -118,19 +110,6 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary { loadDictionary(); } - private String getChangedWordForUri(final Uri uri) { - final Cursor cursor = mContext.getContentResolver().query(uri, - PROJECTION_QUERY, null, null, null); - if (cursor == null) return null; - try { - if (!cursor.moveToFirst()) return null; - final int indexWord = cursor.getColumnIndex(Words.WORD); - return cursor.getString(indexWord); - } finally { - cursor.close(); - } - } - @Override public synchronized void close() { if (mObserver != null) { -- cgit v1.2.3-83-g751a